[英]why (miniconda) pip install in .local
pip install
is installing packages in my user's .local
directory, a behaviour that I would like to avoid. pip install
正在我的用户的.local
目录中安装软件包,我想避免这种行为。 Here is my setup:这是我的设置:
(base) MYUSER@MYMACHINE:~$ which pip
/home/MYUSER/miniconda3/bin/pip
(base) MYUSER@MYMACHINE:~$ which python
/home/MYUSER/miniconda3/bin/python
An example trying to install bottleneck
:尝试安装
bottleneck
的示例:
(base) MYUSER@MYMACHINE:~$ pip install bottleneck -v
...
Installing collected packages: numpy, bottleneck
changing mode of /home/MYUSER/.local/bin/f2py to 775
changing mode of /home/MYUSER/.local/bin/f2py3 to 775
changing mode of /home/MYUSER/.local/bin/f2py3.6 to 775
Successfully installed bottleneck-1.3.2 numpy-1.19.0
Cleaning up...
Although I expect bottlneck
to be installed in /home/MYUSER/miniconda3/lib/python3.7/site-packages
, it actually gets installed in .local
instead:虽然我希望
bottlneck
安装在/home/MYUSER/miniconda3/lib/python3.7/site-packages
中,但它实际上安装在.local
中:
(base) MYUSER@MYMACHINE:~$ ls ~/.local/lib/python3.6/site-packages/bottleneck/
benchmark nonreduce_axis.cpython-36m-x86_64-linux-gnu.so _pytesttester.py src
__init__.py nonreduce.cpython-36m-x86_64-linux-gnu.so reduce.cpython-36m-x86_64-linux-gnu.so tests
move.cpython-36m-x86_64-linux-gnu.so __pycache__ slow _version.py
I hope I have provided enough information to debug this.我希望我已经提供了足够的信息来调试它。
A crucial piece of information that I thought was irrelevant is that I am executing these commands in a VNC
session.我认为无关紧要的一条关键信息是我在
VNC
session 中执行这些命令。 It was brought to my attention that the environment variables when a new terminal is launched within the VNC
session are inherited from the terminal that created the VNC
session.我注意到在
VNC
session 中启动新终端时的环境变量是从创建VNC
session 的终端继承的。
For more information:了解更多信息:
https://unix.stackexchange.com/questions/400329/gnome-terminal-inherits-some-environment-even-with-env-i-on-a-vnc-session https://unix.stackexchange.com/questions/400329/gnome-terminal-inherits-some-environment-even-with-env-i-on-a-vnc-session
In my case, the environment variables (ie PATH, PYTHONPATH) were messed up due to the above reason.就我而言,由于上述原因,环境变量(即 PATH、PYTHONPATH)被搞砸了。 Solved now
现已解决
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.