I'm currently using mac and whenever, I'm launching the terminal it will show like code below. I tried all the method in stackoverflow but it didnt work, so I'm posting my own. Please help me to fix this. I had tried "sudo apt-get install python3-pip" or "sudo pip3 install virtualenvwrapper". They are all installed
Message
Last login: Tue Aug 18 22:33:59 on ttys000
virtualenvwrapper_run_hook:12: no such file or directory: /usr/local/bin/python3
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/local/bin/python3 and that PATH is
set properly.
Which python command
/usr/bin/python
Python version command
Python 2.7.16
Which python3 command
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
Python version3 command
Python 3.7.4
pip3 --version command
pip 19.3.1 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
I'm currently using mac and whenever, I'm launching the terminal it will show like code below. I tried all the method in stackoverflow but it didnt work, so I'm posting my own. Please help me to fix this. I had tried "sudo apt-get install python3-pip" or "sudo pip3 install virtualenvwrapper". They are all installed
Message
Last login: Tue Aug 18 22:33:59 on ttys000
virtualenvwrapper_run_hook:12: no such file or directory: /usr/local/bin/python3
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/local/bin/python3 and that PATH is
set properly.
Which python command
/usr/bin/python
Python version command
Python 2.7.16
Which python3 command
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
Python version3 command
Python 3.7.4
pip3 --version command
pip 19.3.1 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
Virtualenvwrapper needs to know correct python3 path.
Try to set variable containing path to python3 running following command:
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
If it helps, you should run this command every time you initialize a bash or zsh session.
To do this automatically, add the command to your ~/.bashrc
or ~/.zshrc
file, depending on what you use.
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.