質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

1回答

4511閲覧

pipでmecabインストール時のエラー

KKKKKRugby

総合スコア1

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

0クリップ

投稿2022/11/16 07:33

前提

ここに質問の内容を詳しく書いてください。
(例)
TypeScriptで●●なシステムを作っています。
■■な機能を実装中に以下のエラーメッセージが発生しました。

実現したいこと

VScodeで形態素解析をpythonで行う
そのなかでのpipを使ったときに出たエラー

発生している問題・エラーメッセージ

Collecting mecab-python3
Using cached mecab-python3-1.0.5.tar.gz (77 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: mecab-python3
Building wheel for mecab-python3 (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [13 lines of output]
C:\Users\kaito\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\MeCab
copying src\MeCab\cli.py -> build\lib.win-amd64-cpython-311\MeCab
copying src\MeCab_init_.py -> build\lib.win-amd64-cpython-311\MeCab
running build_ext
building 'MeCab._MeCab' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mecab-python3
Running setup.py clean for mecab-python3
Failed to build mecab-python3
Installing collected packages: mecab-python3
Running setup.py install for mecab-python3 ... error
error: subprocess-exited-with-error

× Running setup.py install for mecab-python3 did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
C:\Users\kaito\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
running install
C:\Users\kaito\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\MeCab
copying src\MeCab\cli.py -> build\lib.win-amd64-cpython-311\MeCab
copying src\MeCab_init_.py -> build\lib.win-amd64-cpython-311\MeCab
running build_ext
building 'MeCab._MeCab' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> mecab-python3

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

該当のソースコード

ソースコード

試したこと

mecabを入れなおしたりした

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jbpb0

2022/11/17 00:30

> C:\Users\kaito\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. python 3.11を使ってますが、 https://pypi.org/project/mecab-python3/#files には3.11用のwheel(*.whl)は用意されてません ファイル名の「cp数字」の「数字」がpythonのバージョンですが、「cp311」が付いたのはありません それで、ソース > Using cached mecab-python3-1.0.5.tar.gz (77 kB) が使われてます pythonのバージョンをwheelが用意されてる3.6〜3.10に変えたら、ソースではなくwheelが使われて、すんなりとインストールできるのではないですかね python 3.11はリリースされたばかりで、他にも対応してないものがまだいろいろあるので、しばらくは使わない方がいいですよ
KKKKKRugby

2022/11/17 04:56

pythonのバージョンを落としてみるということですね。一度試してみます。
KKKKKRugby

2022/11/17 05:14

C:\Users\kaito>pip install mecab-python-windows Collecting mecab-python-windows Using cached mecab-python-windows-0.996.3.tar.gz (53 kB) Preparing metadata (setup.py) ... done Installing collected packages: mecab-python-windows DEPRECATION: mecab-python-windows is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for mecab-python-windows ... error error: subprocess-exited-with-error × Running setup.py install for mecab-python-windows did not run successfully. │ exit code: 1 ╰─> [8 lines of output] running install running build running build_py file MeCab.py (for module MeCab) not found file MeCab.py (for module MeCab) not found running build_ext building '_MeCab' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> mecab-python-windows note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. 新しくこのようなエラーが出たのですが何が原因でしょうか?
jbpb0

2022/11/17 06:05 編集

> C:\Users\kaito>pip install mecab-python-windows あれ? 今回は「mecab-python-windows」を入れようとしてるのですか 質問に > Collecting mecab-python3 と書かれてたので、「mecab-python-windows」ではなく「mecab-python3」を入れようとしてるのかと思い、それのwheelは https://pypi.org/project/mecab-python3/#files から、python 3.6~3.10用が用意されてると紹介しました 「mecab-python-windows」だと話が違ってきます https://pypi.org/project/mecab-python-windows/#files を見ると、wheelが用意されてるのはpython 2.7, 3.6, 3.7ですね 【追記】 https://qiita.com/yukinoi/items/990b6933d9f21ba0fb43 に 「過去にmecab-python-windowsというものを公開しましたが、そちらは今後アップデートしないつもり」 と書かれてます
guest

回答1

0

C:\Users\kaito\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.

python 3.11を使ってますが、
ファイルをダウンロード
には3.11用のwheel(*.whl)は用意されてません
ファイル名の「cp数字」の「数字」がpythonのバージョンですが、「cp311」が付いたのはありません

それで、ソース

Using cached mecab-python3-1.0.5.tar.gz (77 kB)

が使われてます

pythonのバージョンをwheelが用意されてる3.6〜3.10に変えたら、ソースではなくwheelが使われて、すんなりとインストールできるのではないですかね

投稿2022/11/28 09:34

jbpb0

総合スコア7651

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問