运行 代码后缺少已安装的库
Already installed libraries missing after running the code
我正在尝试 运行 集群上虚拟 python 环境中的代码。在这里,我使用 pip install ____ 命令安装了所有相关的库,例如 h5py、plotly、tqdm、mpi4py 和 vtk,所有这些库都安装得很好。但是当我 运行 我的代码时,系统再次开始请求这些库。此时,如果我尝试重新安装这些库,我会收到如下提示:
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 命令不起作用,因为它是一个我无权使用它的集群。
可能是什么原因导致了这个问题,可能的解决方案是什么?
.....
you should not use sudo with pip 同时激活了 virtualenv。
尝试以这种方式安装库:
# installs on virtualenv's python:
$ .env/bin/python -m pip install yourlibrary
我正在尝试 运行 集群上虚拟 python 环境中的代码。在这里,我使用 pip install ____ 命令安装了所有相关的库,例如 h5py、plotly、tqdm、mpi4py 和 vtk,所有这些库都安装得很好。但是当我 运行 我的代码时,系统再次开始请求这些库。此时,如果我尝试重新安装这些库,我会收到如下提示:
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 命令不起作用,因为它是一个我无权使用它的集群。
可能是什么原因导致了这个问题,可能的解决方案是什么?
.....
you should not use sudo with pip 同时激活了 virtualenv。 尝试以这种方式安装库:
# installs on virtualenv's python:
$ .env/bin/python -m pip install yourlibrary