I just downloaded Python 3.6.1, but when I type python3 -V
in the terminal it's still Python 3.5.3
. How can I make python3
point to Python 3.6
? All versions are in the /usr/bin/
directory.
Better to simply call python3. 6 explicitly in those programs where it matters, and leave the python3 symlink as is. This command will create a link in: /usr/bin/python3 to /usr/bin/python3. 6 .
To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World!
The Python3 command was introduced because the python command pointed to python2. Since then, Python3 has become the default and thus python points to python3 on most but not all systems. So, most developers explicitly use python2 and python3 as to not run into issues on other systems.
do
rm /usr/bin/python3 ln -s /usr/bin/python3.6 /usr/bin/python3
much better solution:
Damn, Python is used throughout much of Ubuntu for system scripts and software, and software relies on having Python (and the commands to start Python) in a certain spot. do back then.
rm /usr/bin/python3 ln -s /usr/bin/python3.5 /usr/bin/python3
create alias in ~/.bash_aliases
alias python3='/usr/bin/python3.6'
Scripts can then start with something like:
#!/usr/bin/env python3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With