Ubuntu安装虚拟环境-bash: /usr/bin/python: No such file or directory
出现报错
root@dev1:~# source .bashrc
-bash: /usr/bin/python: No such file or directory
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
root@dev1:~# cd /usr/lib/python3
root@dev1:/usr/lib/python3# ls
加上这两句话
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv

重新source .bashrc即可
本文解决在Ubuntu中使用virtualenvwrapper.sh时遇到的错误,包括找不到python解释器和初始化钩子运行问题。通过设置VIRTUALENVWRAPPER_PYTHON和VIRTUALENVWRAPPER_VIRTUALENV环境变量,并重新加载bash配置文件,成功解决了问题。
1万+

被折叠的 条评论
为什么被折叠?



