分享技术,记录生活,在互联网上留下属于自己的一亩三分地。

Ubuntu安装虚拟环境中出现/usr/bin/python: No module named virtualenvwrapper virtualenvwrapper.sh: …

Linux novadmin 143℃ 0评论

Ubuntu安装虚拟环境中出现/usr/bin/python: No module named virtualenvwrapper virtualenvwrapper.sh: …

 


zhj@zhj-machine:~$ source /usr/local/bin/virtualenvwrapper.sh 
/usr/bin/python: No module named virtualenvwrapper
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.

解决办法:在命令行中,添加环境变量(我这里是python3环境)

然后再执行,就不会报错了。


zhj@zhj-machine:~$ export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
zhj@zhj-machine:~$ export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
zhj@zhj-machine:~$ source /usr/local/bin/virtualenvwrapper.sh 
virtualenvwrapper.user_scripts creating /home/zhj/Envs/premkproject
virtualenvwrapper.user_scripts creating /home/zhj/Envs/postmkproject
virtualenvwrapper.user_scripts creating /home/zhj/Envs/initialize
virtualenvwrapper.user_scripts creating /home/zhj/Envs/premkvirtualenv
virtualenvwrapper.user_scripts creating /home/zhj/Envs/postmkvirtualenv
virtualenvwrapper.user_scripts creating /home/zhj/Envs/prermvirtualenv
virtualenvwrapper.user_scripts creating /home/zhj/Envs/postrmvirtualenv
virtualenvwrapper.user_scripts creating /home/zhj/Envs/predeactivate
virtualenvwrapper.user_scripts creating /home/zhj/Envs/postdeactivate
virtualenvwrapper.user_scripts creating /home/zhj/Envs/preactivate
virtualenvwrapper.user_scripts creating /home/zhj/Envs/postactivate
virtualenvwrapper.user_scripts creating /home/zhj/Envs/get_env_details

 

转载请注明:Nov » Ubuntu安装虚拟环境中出现/usr/bin/python: No module named virtualenvwrapper virtualenvwrapper.sh: …

喜欢 (0)or分享 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址