无法安装pipenv,无法升级pip的设置工具

时间:2018-03-26 22:27:03

标签: python python-3.x python-2.7 pip pipenv

我正在尝试设置环境以在新笔记本电脑上执行一些Python。我先做了brew install python3,然后去确保我用pip --version安装了pip。终端说我没有,所以我做了brew install pip

然后我用pip install pipenv安装了pipenv。我收到此错误消息:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-build-o6M3Ve/pipenv/.

搜索到这一点,我看到有人说pip的设置工具需要使用pip install --upgrade setuptools进行更新。当我尝试时,我得到了一个很长的错误,我将在下面发布。我已经超越了这个,并且不知道从哪里开始。任何和所有的帮助表示赞赏。

例外:

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.3-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors

错误:

[('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/var/folders/9t/pk6bmgc968d_fys24blkrgc40000gn/T/pip-Rp7V_U-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

1 个答案:

答案 0 :(得分:1)

您已安装Python版本3但属于Python版本2的pip。首先,卸载已安装的pip。现在你应该安装pip3,例如使用brew install pip3。但是,pip3应该与Python 3一起安装,所以首先要确保pip3还没有安装。