在学习本教程后,我遇到了一个问题:
https://docs.python-guide.org/dev/virtualenvs/ 它告诉我运行“ source /usr/local/bin/virtualenvwrapper.sh” 但是由于它不存在,请在以下位置更新并查找报告: “〜/ .local / bin / virtualenvwrapper.sh”
所以遇到这个问题似乎阻止了我前进:
charles@lamborghini:~$ source ~/.local/bin/virtualenvwrapper.sh
Command '' not found, but can be installed with:
sudo apt install bpfcc-tools # version 0.8.0-4, or
sudo apt install mailutils-mh # version 1:3.5-2build1
sudo apt install mmh # version 0.4-2
sudo apt install nmh # version 1.7.1-4
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= and that PATH is
set properly.
charles@lamborghini:~$ echo $VIRTUALENVWRAPPER_PYTHON
charles@lamborghini:~$
我应该担心吗? mkvirtualenv可以正常工作。
答案 0 :(得分:0)
已修复:
charles@lamborghini:~/project_folder$ VIRTUALENVWRAPPER_PYTHON=$(which python3)
charles@lamborghini:~/project_folder$ source ~/.local/bin/virtualenvwrapper.sh
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/premkproject
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/postmkproject
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/initialize
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/premkvirtualenv
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/postmkvirtualenv
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/prermvirtualenv
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/postrmvirtualenv
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/predeactivate
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/postdeactivate
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/preactivate
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/postactivate
virtualenvwrapper.user_scripts creating /home/charles/.virtualenvs/get_env_details
charles@lamborghini:~/project_folder$