【问题标题】:Downloading Requests for python error on ubuntu在 ubuntu 上下载 python 错误的请求
【发布时间】:2014-06-30 14:29:57
【问题描述】:

我正在我的电脑上运行 ubuntu,我正在尝试下载 requests

但是,当我执行pip install requests 时,它给了我一个错误:

writing manifest file 'requests.egg-info/SOURCES.txt'

running install_lib

creating /usr/local/lib/python2.7/dist-packages/requests

error: could not create '/usr/local/lib/python2.7/dist-packages/requests': Permission denied

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/alejandro/build/requests/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-tT3Boe-record/install-record.txt failed with error code 1

有没有人有关于如何克服或修复它的任何提示?

【问题讨论】:

    标签: python python-2.7 terminal ubuntu-12.04 python-requests


    【解决方案1】:

    你的错误

    could not create '/usr/local/lib/python2.7/dist-packages/requests': Permission denied
    

    建议您尝试以普通用户身份在系统范围内安装软件包 - 您无权执行此操作。

    您可以使用--user 选项为自己安装软件包:

    pip install --user requests
    

    ... 或使用sudo 以root 身份在系统范围内安装它:

    sudo pip install requests
    

    或者,您可以考虑使用virtual environment

    【讨论】:

      猜你喜欢
      • 2020-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-14
      • 2018-10-20
      • 1970-01-01
      • 1970-01-01
      • 2020-05-02
      相关资源
      最近更新 更多