Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system:

微笑、不失礼 提交于 2019-12-23 02:38:57

问题


I am trying to follow this guide to install python modules however i don't seem to have virtual environment or pip installed so im trying to get those to continue.

Python 2.7.5 is installed on my cpanel, i want to install extra modules for my scripts. I download:

get-pip.py using curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

I then try running the python file with:

python get-pip.py

It starts but fails at: Installing collected packages: pip, wheel. With error message:

Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/usr/lib/python2.7/site-packages/pip'

If i use sudo python get-pip.py

I get the following error message:

jailshell: sudo: command not found

Thanks


回答1:


I'd the same problem in my ChromeOS and I couldn't solve it running chmod -R in my site-packages folder. To solve it I had to install pip only for my user running:

python get-pip.py --user

The only problem is that you have to run pip as a python module python -m pip, but you can create an alias inside your .bashrc.

# ~/.bashrc
#
# ...
alias pip="python -m pip"


来源:https://stackoverflow.com/questions/53883535/could-not-install-packages-due-to-an-environmenterror-errno-30-read-only-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!