我正在尝试在Ubuntu 14.04 LTS上安装jupyter,但我一直收到此错误。我尝试为每个文件夹授予权限,并将代码运行为:
sudo -H pip3 install --user jupyter
但没有任何效果。我也在pip上做了更新,它运行的是最新版本。
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 "/root/.local/lib/python3.4/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/root/.local/lib/python3.4/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/root/.local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/root/.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'
感谢您的帮助!
答案 0 :(得分:3)
对我而言,它适用于最近的pyparsing包。也许你需要将你的pyparsing升级到最新版本。如果你用apt-get安装它,你需要删除python3-pyparsing包,并用pip3安装它。
sudo apt remove python3-pyparsing
sudo pip3 install pyparsing
当this answer写道时,您需要使用pyparsing&gt; = 2.0.2来避免此错误。
答案 1 :(得分:1)
我也遇到了这个错误,经过一些挖掘后我发现this question解决了其他软件造成的同样错误。
正如作者所述,问题是对MARKER_EXPR()
的呼叫应该有一个名称&#39;争论,但它没有。
要解决此问题,请修改/usr/local/lib/python3.4/dist-packages/packaging/requirements.py
的第59行,然后在MARKER_EXPR()
的调用中添加引号,如下所示:
MARKER_EXPR = originalTextFor(MARKER_EXPR(""))("marker")
答案 2 :(得分:0)