简体   繁体   中英

Already installed libraries missing after running the code

I am trying to run a code in a virtual python environment on a cluster. Here, I installed all the relevant libraries such as h5py, plotly, tqdm, mpi4py and vtk using pip install ____ command and all of these libraries installed just fine. But when I run my code, the system start asking for these libraries again. At this point, if I try to reinstall these libraries I get prompts like:

WARNING: The directory '/gpfs/fs1/home//a5saieed/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Defaulting to user installation because normal site-packages is not writeable

sudo command doesn't work since it's a cluster on which I do not have the right to use it.

What might be causing this problem and what could be it's possible solution?

.....

you should not use sudo with pip while having virtualenv activated. Try install the libraries in this way:

# installs on virtualenv's python:
$ .env/bin/python -m pip install yourlibrary

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM