简体   繁体   English

在ubuntu上下载python错误请求

[英]Downloading Requests for python error on ubuntu

I'm running ubuntu on my computer and I'm trying to download requests . 我在计算机上运行ubuntu,正在尝试下载请求

However, when I do pip install requests it gives me an error: 但是,当我执行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

Does anyone have any tips on how to get past this or fix it? 是否有人有任何技巧可以解决或解决此问题?

Your error 你的错误

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

suggests that you tried to install the package system-wide as a regular user - which you don't have permission to do. 建议您尝试以普通用户的身份在系统范围内安装该软件包-您无权执行此操作。

You can either install the package just for yourself with the --user option: 您可以使用--user选项为自己安装软件包:

pip install --user requests

... or install it system-wide as root using sudo : ...或使用sudo在系统范围内以root身份安装:

sudo pip install requests

Alternatively, you could look into using a virtual environment . 或者,您可以考虑使用虚拟环境

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM