I tried to upgrade python 2.7 to python 3 and I modified the file ~/.bash_aliases
but when I type python in elementary terminal I get this error
zsh: command not found: python3
and when I type which python
python: aliased to python3
actually I prefer return to python 2.7 or if someone know how can I fix this:c
Go into your .zshrc file. Is there a line that reads:
alias python='python3'
If so, remove that line. Else, check if you can run python2
, python2.7
, or something like that. If so, then just hack and add the line
alias python='python2'
Or whatever your python2 is. Else, type
sudo apt-get install python2.7
Or whatever is the appropriate method for installing programs on your system.
Follow this steps if you are using macOS.
brew install python
. This will install the latest version of Python. If you want Python 2.7, do well to specify the version.brew info python
. You will see a path similar to: /usr/local/opt/python@3.9/libexec/bin
$ echo 'export PATH="/usr/local/opt/python@3.9/libexec/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
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.