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.