前提・実現したいこと
形態素解析を行うためにMeCabをインストールし、Python上にmecab-python3の導入を行おうとしましたが、pipのバージョンが古いとエラーが出たので、"pip install --upgrade pip"と入力しアップグレードを試みたところエラーが表示されました。
(書いてある情報で足りない情報があれば教えて下さい。)
発生している問題・エラーメッセージ
pipをアップグレードできないこと。構文エラーだということは分かりますが、どこを直せばよいか分からず困っています。
ユーザー名をuserと書き換えています。
[user]$ pip install --upgrade pip Collecting pip Using cached https://files.pythonhosted.org/packages/da/f6/c83229dcc3635cdeb51874184241a9508ada15d8baa337a41093fab58011/pip-21.3.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-Llcb_X/pip/setup.py", line 7 def read(rel_path: str) -> str: ^ SyntaxError: invalid syntax ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Llcb_X/pip/ You are using pip version 8.1.2, however version 21.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
該当のソースコード
Cygwin上で行っています
Python
1[user]$ pip install mecab-python3 2Collecting mecab-python3 3 Using cached https://files.pythonhosted.org/packages/5a/90/348cda0312df7ff25d57ca56560b6871be42e48a99b1ddc091f6f23e96cc/mecab-python3-1.0.4.tar.gz 4 Complete output from command python setup.py egg_info: 5 Couldn't find index page for 'setuptools_scm' (maybe misspelled?) 6 No local packages or download links found for setuptools-scm 7 Traceback (most recent call last): 8 File "<string>", line 1, in <module> 9 File "/tmp/pip-build-v2uqO3/mecab-python3/setup.py", line 237, in <module> 10 "License :: OSI Approved :: BSD License", 11 File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup 12 _setup_distribution = dist = klass(attrs) 13 File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__ 14 self.fetch_build_eggs(attrs.pop('setup_requires')) 15 File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs 16 parse_requirements(requires), installer=self.fetch_build_egg 17 File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve 18 dist = best[req.key] = env.best_match(req, self, installer) 19 File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match 20 return self.obtain(req, installer) # try and download/install 21 File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain 22 return installer(requirement) 23 File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg 24 return cmd.easy_install(req) 25 File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in easy_install 26 raise DistutilsError(msg) 27 distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools-scm') 28 29 ---------------------------------------- 30Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v2uqO3/mecab-python3/ 31You are using pip version 8.1.2, however version 21.3.1 is available. 32You should consider upgrading via the 'pip install --upgrade pip' command. 33[user]$ pip install --upgrade pip 34Collecting pip 35 Using cached https://files.pythonhosted.org/packages/da/f6/c83229dcc3635cdeb51874184241a9508ada15d8baa337a41093fab58011/pip-21.3.1.tar.gz 36 Complete output from command python setup.py egg_info: 37 Traceback (most recent call last): 38 File "<string>", line 1, in <module> 39 File "/tmp/pip-build-HM8YQ2/pip/setup.py", line 7 40 def read(rel_path: str) -> str: 41 ^ 42 SyntaxError: invalid syntax 43 44 ---------------------------------------- 45Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-HM8YQ2/pip/ 46You are using pip version 8.1.2, however version 21.3.1 is available. 47You should consider upgrading via the 'pip install --upgrade pip' command. 48[user]$ 49
試したこと
・"pip install --upgrade --force-reinstall <package>"を打ち込み、強制的にpipをアップグレードしようとしましたが、"-bash: syntax error near unexpected token `newline'"と表示されエラーが出ました。
・"$ python -v"と入力すると"Python 2.7.5"と返ってきますが、"$ python3 -v"と入力しても
"-bash: python3: command not found"と表示されるので、Python3が入っていないと思います。
補足情報(FW/ツールのバージョンなど)
”Cygwin上のSSHクライアント”を用いて、ABCI(https://abci.ai/ja/)にログインしています。
回答2件
あなたの回答
tips
プレビュー