问题描述
我正在尝试遵循此指南进行安装python模块,但是我似乎没有安装虚拟环境或pip,所以我试图让它们继续.
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安装在我的cpanel上,我想为我的脚本安装额外的模块.我下载:
Python 2.7.5 is installed on my cpanel, i want to install extra modules for my scripts. I download:
get-pip.py
使用curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
然后我尝试使用以下命令运行python文件:
I then try running the python file with:
python get-pip.py
它开始但在以下位置失败:Installing collected packages: pip, wheel
.出现错误消息:
It starts but fails at: Installing collected packages: pip, wheel
.With error message:
如果我使用sudo python get-pip.py
我收到以下错误消息:
谢谢
推荐答案
我在ChromeOS中遇到了同样的问题,但是在site-packages
文件夹中运行chmod -R
时却无法解决.为了解决这个问题,我只需要为正在运行的用户安装pip
:
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
唯一的问题是您必须将pip作为python模块python -m pip
运行,但是您可以在.bashrc
内部创建别名.
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"
这篇关于由于环境错误而无法安装软件包:[Errno 30]只读文件系统:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!