0

My SSD died. All my projects were stored on HDD ( and worked smoothly without any issues), so I just bought another SSD and installed the new OS (Manjaro, the old one was Fedora, if it matters).

Some of my projects used pip global packages, so i had to reinstall them. But i wasn't able just type "pip install package-name", because it threw
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/lib/python3.7/site-packages/Django-2.2.7.dist-info'

Checking permissions show me the owner can modify and execute contents, so I don't understand what's wrong.

Also pip and python came preinstalled with my distro, and that's kinda strange that it doesn't work as intended. System is also almost fresh, so i don't think that I broke something.

After all I "fixed" this issue by installing previously global packages in virtualenv. I was able to install them, but I just cannot use them due to errors which are caused by lack of permissions (at least as Google says).

For example libsass, if I try to "import sass", I get this error:

ImportError: /mnt/data/Projects/Work/transport/venv/lib/python3.7/site-packages/_sass.cpython-37m-x86_64-linux-gnu.so: failed to map segment from shared object

Answers to simular problems here mention lack of permissions in /tmp, so i did what answers said with /tmp, and it didn't change anything. I've even tried to set permissions to 777 on the HDD, and it still doesn't work.

Upd: apparently cannot start any python project that has pip package with .so. They all give the same error: failed to map segment from shared object .

Upd2: okay, seems like there is issue with permissions on HDD specifically. If i copy project to the home directory for example, or anywhere outside HDD, it works, and there is no "failed to map segment from shared object". Moreover even if i set 777 permissions for project directory recursively ( so for venv and so for all packages including these .so ) i still get this error if project directory is located on HDD, i am getting out of mind. And i still cannot install pip packages globally unless using sudo.

  • Is /mnt/data/.../_sass.cpython-37m-x86_64-linux-gnu.so a library from your old system? Perhaps it needs to be updated to match the new one. – roaima Nov 7 '19 at 23:09
  • /mnt/data is my HDD, not old system, if i understood your question correctly. I've also tried to delete virtual environment, make another one and reinstall packages there, and that doesn't work too. – Supremus Nov 7 '19 at 23:26
  • I don't understand what you keep referring to as a "virtual environment". Aisde from that, the /mnt/... path is definitely a library from your old system. It's probably not compatible with the new and like I've suggested already you're going to need to rebuild it or reinstall it. – roaima Nov 7 '19 at 23:41
  • This will explain much better than me what is venv in python docs.python.org/3/tutorial/venv.html. /mnt/data is my HDD which never died. My projects were there before my SSD death, and they are still here. And these projects have venv directories inside them which contain all packages and libraries. And i've already tried reinstalling packages, doesn't change anything. – Supremus Nov 7 '19 at 23:46
0

The problem was so primitive, i don't think it's even worth answer. Actually my HDD mounted with noexec flag on my new system. Which caused all these problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.