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

2

9

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

Cofer answered 21/12, 2018 at 10:54 Comment(8)
did you try with sudo?Espalier
using sudo i get: jailshell: sudo: command not foundCofer
which OS are you using?Espalier
probably this can be helpful : github.com/pypa/virtualenv/issues/209 if you are using virtual envQuash
its cPanel so how do i find out? @EspalierCofer
I am trying to instal pip so i can install virtual environment so i can install modules. @RoshanBagdiyaCofer
Try to install pip on your device. That s the way how it should work. Python was build up to provide always one solution for a problem.Cherie
But I need to install pip on cPanel which I'm having trouble doing so that I can run python programs on cPanel so that they can communicate with MySQL as my cPanel does not support remote MySQL. @CherieCofer
I
6

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"
Icecap answered 30/4, 2019 at 19:46 Comment(0)
M
4

Run this issue on my local MacOS with pip2.7, trying to install jwt package

sudo pip2.7 install jwt pyjwt[crypto]
...
ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/...'
...
..

No sudo or trying to chmod the read-only file helped. Solved installation with --user parameter:

sudo pip2.7 install --user jwt pyjwt[crypto]
Mercy answered 6/2, 2021 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.