[英]pyenv is using system python instead of virtual environment
I've been using pyenv for a long time, without any troubles.我一直在使用 pyenv 很长一段时间,没有任何麻烦。 I set up it properly and everything worked.
我正确设置了它,一切正常。
However, while I was trying to solve another problem, I run some line which ruined my pyenv instalation.然而,当我试图解决另一个问题时,我运行了一些破坏了我的 pyenv 安装的行。
Now, when I activate any virtualenv, it tries to use system's python instead of pyenv's:现在,当我激活任何 virtualenv 时,它会尝试使用系统的 python 而不是 pyenv 的:
$ pyenv activate foo
(foo) $ which python
/usr/bin/python
(foo) $ pip --version
pip 20.3.4 from /home/rodrigo/.local/lib/python2.7/site-packages/pip (python 2.7)
I'm not sure exactly which line was the one that ruined it, it may be the following: (foo) $ pip install --upgrade pip setuptools wheel
from the foo
environment (I run it when it still worked), but may be another.我不确定到底是哪一行毁了它,它可能是以下内容:
(foo) $ pip install --upgrade pip setuptools wheel
from the foo
环境(我在它仍然工作时运行它),但可能是其他。
I already checked ~/.bashrc
file and it is ok;我已经检查了
~/.bashrc
文件,没问题; restarted the console and even changed to a different environment foo2
and the problem is still there...重新启动控制台,甚至更改为不同的环境
foo2
,问题仍然存在...
I already checked similar questions like this or this , but those are related to miss-configurations which I already tested and are ok.我已经检查过类似这样或这样的问题,但那些与我已经测试过并且没问题的配置错误有关。
I'm using Ubuntu 18.04 LTS and pyenv 2.0.3-8-gad880754我使用的是 Ubuntu 18.04 LTS 和 pyenv 2.0.3-8-gad880754
UPDATE I re-installed pyenv but it still doesn't work更新我重新安装了 pyenv 但它仍然不起作用
I have the same problem as you,Finally changed vim ~/.zshrc it became easier to use我和你有同样的问题,终于改了vim ~/.zshrc 好用了
Change eval "$(pyenv init -)" to eval "$(pyenv init --path)" and start a new shell.将 eval "$(pyenv init -)" 更改为 eval "$(pyenv init --path)" 并启动一个新的 shell。
Seems like this was a change that was introduced in 2.0似乎这是 2.0 中引入的更改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.