尝试安装ipython时出现奇怪错误
我跑 在命令行完成安装过程后,出现以下错误:尝试安装ipython时出现奇怪错误,python,ipython,Python,Ipython,我跑 在命令行完成安装过程后,出现以下错误: sudo pip install ipython 正在为scandir运行setup.py安装程序。。。错误 从命令/usr/bin/python-u-c“import”完成输出 setuptools,tokenize;_文件_='/private/tmp/pip build- szsEFp/scandir/setup.py';f=getattr(标记化,'open',open) (\r\n文件);code=f.read().replace('\r
sudo pip install ipython
正在为scandir运行setup.py安装程序。。。错误
从命令/usr/bin/python-u-c“import”完成输出
setuptools,tokenize;_文件_='/private/tmp/pip build-
szsEFp/scandir/setup.py';f=getattr(标记化,'open',open)
(\r\n文件);code=f.read().replace('\r\n',
'\n');f.close();exec(编译(代码,_u文件,_u,_u,'exec'))“安装--记录
/tmp/pip-iOop0U-record/install-record.txt——外部单一版本-
托管--编译:
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/Library/Python/2.7/site-packages/setuptools/_-init___;u.py”,
第12行,在
导入setuptools.version
文件“/Library/Python/2.7/site packages/setuptools/version.py”,第1行,在
导入pkg_资源
文件“/Library/Python/2.7/site packages/pkg_resources/_init__.py”,第72行,在
进口包装.要求
文件“/Library/Python/2.7/site packages/packaging/requirements.py”,第59行,在
MARKER_EXPR=originalTextFor(MARKER_EXPR())(“MARKER”)
TypeError:\uuuuu call\uuuuuuu()正好接受2个参数(给定1个)
----------------------------------------
命令“/usr/bin/python-u-c”导入setuptools,
标记化__文件\ \='/private/tmp/pip build-
szsEFp/scandir/setup.py';f=getattr(标记化“打开”,打开)
(文件);code=f.read().replace('\r\n',
“\n”);f、 close();exec(编译(代码,文件,exec'))“安装--记录
/tmp/pip-iOop0U-record/install-record.txt——外部单一版本-
managed--compile“在/private/tmp/pip build中失败,错误代码为1-
szsEFp/斯堪的纳维亚/
发生了什么事?我不知道哪里出了问题,但我知道安装iPython、Jupyter堆栈的其余部分以及其他难以安装的依赖项的最简单方法是使用。我非常喜欢它。请尝试
sudo easy\u install ipython
。。。在mac电脑上似乎效果更好。我敢肯定你已经陷入了一个案例,你已经安装了两个不同版本的setuptools的一部分;如果easy_install也不起作用,您可能需要执行pip卸载setuptools
。Setuptools实际上很难升级,不过我认为可以强制删除,然后用pip安装。Anaconda要简单得多,但是如果你不想要Anaconda,你可以创建一个virtualenv(pip install virtualenv
),然后安装在那里。我最终从网站上安装了Anaconda。我不知道那里出了什么问题,但我知道的最简单的方法是安装iPython和Jupyter堆栈的其余部分,与其他难以安装的依赖项一起使用。我非常喜欢它。请尝试sudo easy\u install ipython
。。。在mac电脑上似乎效果更好。我敢肯定你已经陷入了一个案例,你已经安装了两个不同版本的setuptools的一部分;如果easy_install也不起作用,您可能需要执行pip卸载setuptools
。Setuptools实际上很难升级,不过我认为可以强制删除,然后用pip安装。Anaconda要简单得多,但是如果你不想要Anaconda,你可以创建一个virtualenv(pip install virtualenv
),然后安装在那里。我最后从网站上安装了Anaconda。
Running setup.py install for scandir ... error
Complete output from command /usr/bin/python -u -c "import
setuptools, tokenize;__file__='/private/tmp/pip-build-
szsEFp/scandir/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
/tmp/pip-iOop0U-record/install-record.txt --single-version-externally-
managed --compile:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.7/site-packages/setuptools/__init__.py",
line 12, in <module>
import setuptools.version
File "/Library/Python/2.7/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/Library/Python/2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools,
tokenize;__file__='/private/tmp/pip-build-
szsEFp/scandir/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
/tmp/pip-iOop0U-record/install-record.txt --single-version-externally-
managed --compile" failed with error code 1 in /private/tmp/pip-build-
szsEFp/scandir/