【问题标题】:installing requirements with pip使用 pip 安装要求
【发布时间】:2016-12-25 18:12:39
【问题描述】:

我对使用 python 和 pip 非常陌生,目前我正在尝试第一次运行 python 程序。 我在 git 上下载了程序,自述文件告诉我运行命令:

pip install -r requirements.txt

我做到了。我现在有一个我不明白的例外。你可以帮帮我吗?

我尝试做 sudo 的事情,但没有帮助。我正在使用 OS X。

这是我从终端得到的答案:

Requirement already satisfied: geopy==1.11.0 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied: gpsoauth==0.3.0 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 2))
Collecting protobuf==3.0.0b3 (from -r requirements.txt (line 3))
  Using cached protobuf-3.0.0b3-py2-none-any.whl
Requirement already satisfied: pycryptodomex==3.4.2 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 4))
Requirement already satisfied: requests==2.10.0 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 5))
Requirement already satisfied: s2sphere==0.2.4 in /Library/Python/2.7/site-packages (from -r requirements.txt (line 6))
Collecting gpxpy==1.1.1 (from -r requirements.txt (line 7))
  Using cached gpxpy-1.1.1.tar.gz
Collecting six>=1.9 (from protobuf==3.0.0b3->-r requirements.txt (line 3))
  Using cached six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from protobuf==3.0.0b3->-r requirements.txt (line 3))
Requirement already satisfied: future in /Library/Python/2.7/site-packages (from s2sphere==0.2.4->-r requirements.txt (line 6))
Installing collected packages: six, protobuf, gpxpy
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-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.1-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.1-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.1-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.1-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.1-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 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/26/d0_xn9hx26g4_nl84j40qp8c0000gn/T/pip-cLBEyu-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

【问题讨论】:

    标签: macos python-2.7 exception installation pip


    【解决方案1】:

    好的,我似乎找到了解决方案:

    sudo pip install -r requirements.txt --upgrade --ignore-installed six
    

    虽然,我真的不知道它做了什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-11
      • 1970-01-01
      • 2021-11-26
      • 1970-01-01
      • 2019-06-21
      • 1970-01-01
      • 2019-08-31
      相关资源
      最近更新 更多