I have used pyenv to create some virtualenv for my project, and a few month ago, it seems to make some confusing problem.
Everytime when I go into the directory which I had set venv, it looks work, but it won't work currectly
root@VM-4-7-debian:~# cd /www/wwwroot/FFXIVBOT
(venv-ffxivbot) root@VM-4-7-debian:/www/wwwroot/FFXIVBOT# pyenv versions
system
3.8.9
3.8.9/envs/venv-ffxivbot
3.8.9/envs/venv-maibot
3.8.9/envs/venv-telegram
3.8.9/envs/venv-temp
3.9.12
* venv-ffxivbot (set by /www/wwwroot/FFXIVBOT/.python-version)
venv-maibot
venv-telegram
venv-temp
(venv-ffxivbot) root@VM-4-7-debian:/www/wwwroot/FFXIVBOT# python --version
Python 2.7.16
(venv-ffxivbot) root@VM-4-7-debian:/www/wwwroot/FFXIVBOT# ~/.pyenv/versions/venv-ffxivbot/bin/python --version
Python 3.8.9
(venv-ffxivbot) root@VM-4-7-debian:/www/wwwroot/FFXIVBOT#
here is the settings in my .bashrc
:
export NVM_DIR="/www/server/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PATH="$PATH:/usr/local/go/bin:~/go/bin"
export HISTTIMEFORMAT="%d/%m/%y %T "
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"alias php='php -c /www/server/php/74/etc/php-cli.ini'
alias php74='php74 -c /www/server/php/74/etc/php-cli.ini'
I really don't know why it will happen.
my PATH:
root@VM-4-7-debian:~# echo $PATH
/root/.pyenv/plugins/pyenv-virtualenv/shims:~/.pyenv/bin:/www/server/nvm/versions/node/v14.16.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-11-oracle/bin:/usr/lib/jvm/java-11-oracle/db/bin:/usr/local/go/bin:~/go/bin
root@VM-4-7-debian:~#
I have just repair it when I try to replace eval "$(pyenv init -)"
into eval "$(pyenv init --path)"
in my .bashrc
.
I think it because pyenv had change the command which will be wrote in .bashrc
.
pyenv has said these two different settings to be wrote into .bashrc
on hisREADME and now eval "$(pyenv init -)"
might be the wrong one.
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.