pip install時報エラーTypeError:_call__()missing 1 required positional argument:'name'解決
7264 ワード
最近Ubuntu 14にいます.04 pip 3を使用してパッケージをインストールするとき、TypeError:call()missing 1 required positional argument:‘name’というエラーが発生しました.具体的なエラーメッセージは以下の通りです.
ziven@ziven-ubuntu-laptop ~ pip3 install --user cheat
Collecting cheat
Downloading cheat-2.2.0.tar.gz (63kB)
100% |████████████████████████████████| 71kB 385kB/s
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "/home/ziven/.local/lib/python3.4/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/home/ziven/.local/lib/python3.4/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/home/ziven/.local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/home/ziven/.local/lib/python3.4/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() missing 1 required positional argument: 'name'
ネットで似たような質問を検索したところ、pyparsingのバージョンが低すぎることが主な原因でした(具体的な原因はこことここを参照してください).解決策は、ローカルのpyparsingのバージョンを>=2.0にアップグレードすることです.2.だから私の地元では次のようなアップグレードをしました.pip3 install --user --upgrade pyparsing
その後、以前のインストールを実行すると正常になります.ziven@ziven-ubuntu-laptop ~ pip3 install --user cheat
Collecting cheat
Using cached cheat-2.2.0.tar.gz
Collecting docopt>=0.6.1 (from cheat)
Downloading docopt-0.6.2.tar.gz
Requirement already satisfied: pygments>=1.6.0 in /usr/lib/python3/dist-packages (from cheat)
Building wheels for collected packages: cheat, docopt
Running setup.py bdist_wheel for cheat ... done
Stored in directory: /home/ziven/.cache/pip/wheels/bb/41/50/bff985ad8a9305bef57ff23efb93aedf92377c8f076c9ab151
Running setup.py bdist_wheel for docopt ... done
Stored in directory: /home/ziven/.cache/pip/wheels/b2/16/5f/c33a2bb5f2dce71205f8e65cbfd05647d79d441282be31fd82
Successfully built cheat docopt
Installing collected packages: docopt, cheat
Successfully installed cheat-2.2.0 docopt-0.6.2