我不是我实验室机器的管理员,我试图在CentOS中使用curl安装pip:
[jalal@ivcgpu1 ~]$ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
[jalal@ivcgpu1 ~]$ python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20061, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 119, in bootstrap
import setuptools # noqa
File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/usr/lib/python2.7/site-packages/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/usr/lib/python2.7/site-packages/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
[jalal@ivcgpu1 ~]$
为什么会发生这种情况以及如何解决?
一些系统信息:
[jalal@ivcgpu1 ~]$ which python
/usr/bin/python
[jalal@ivcgpu1 ~]$ python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
[jalal@ivcgpu1 ~]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
[jalal@ivcgpu1 ~]$ uname -a
Linux ivcgpu1.bu.edu 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
UPDATE1:我不是sudoer因此我无法编辑此答案中提到的文件: https://stackoverflow.com/a/42031999/2414957 UPDATE2:我收到此错误的其他内容如下例:
[jalal@ivcgpu1 ~]$ git clone https://github.com/scikit-image/scikit-image.git
Cloning into 'scikit-image'...
remote: Counting objects: 54661, done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 54661 (delta 31), reused 35 (delta 18), pack-reused 54608
Receiving objects: 100% (54661/54661), 48.24 MiB | 56.99 MiB/s, done.
Resolving deltas: 100% (39918/39918), done.
Checking out files: 100% (735/735), done.
[jalal@ivcgpu1 ~]$ cd scikit-image
[jalal@ivcgpu1 scikit-image]$ python setup.py develop
Traceback (most recent call last):
File "setup.py", line 24, in <module>
import setuptools
File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/usr/lib/python2.7/site-packages/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/usr/lib/python2.7/site-packages/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
[jalal@ivcgpu1 scikit-image]$