[英]Already installed libraries missing after running the code
I am trying to run a code in a virtual python environment on a cluster.我正在尝试在集群上的虚拟 python 环境中运行代码。 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.
在这里,我使用 pip install ____ 命令安装了所有相关库,例如 h5py、plotly、tqdm、mpi4py 和 vtk,并且所有这些库都安装得很好。 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.
警告:目录 '/gpfs/fs1/home//a5saieed/.cache/pip' 或其父目录不属于当前用户或不可写。 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.
如果使用 sudo 执行 pip,您可能需要 sudo 的 -H 标志。 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. sudo 命令不起作用,因为它是一个我无权使用它的集群。
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.在激活 virtualenv 时, 您不应将 sudo 与 pip一起使用。 Try install the libraries in this way:
尝试以这种方式安装库:
# installs on virtualenv's python:
$ .env/bin/python -m pip install yourlibrary
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.