简体   繁体   中英

Downloading Requests for python error on ubuntu

I'm running ubuntu on my computer and I'm trying to download requests .

However, when I do pip install requests it gives me an error:

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:

pip install --user requests

... or install it system-wide as root using sudo :

sudo pip install requests

Alternatively, you could look into using a virtual environment .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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