0

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:~# 
martineau
  • 119,623
  • 25
  • 170
  • 301
Windmourn
  • 1
  • 1
  • .bashrc is not running on cd – flaxon Apr 25 '22 at 22:34
  • what os do you run? read https://github.com/pyenv/pyenv#understanding-path i thnk its a path problem can you print out your path? echo "$PATH" – flaxon Apr 25 '22 at 22:42
  • @flaxon here is my 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` – Windmourn Apr 25 '22 at 23:02

1 Answers1

0

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 his README and now eval "$(pyenv init -)" might be the wrong one.

Windmourn
  • 1
  • 1