B
B
Bagumices2014-01-25 11:31:13
Python
Bagumices, 2014-01-25 11:31:13

How to set python 3.3 as default in ubuntu 13.10?

Can you please tell me how to set python 3.3 as default in ubuntu 13.10, or how to make sublime text 3 work with python 3.3?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Valery, 2014-02-01
@Bagumices

To install python 3 by default in ubuntu, there are 2 ways:
1. add this line alias python=python3to your ~/.bashrcor ~/.bash_aliasesfile and update the file itself source ~/.bashrc(this option will only work for the account under which you add the alias).
2. execute sudo ln -sf python3 /usr/bin/python. this command will update the python link in your /usr/bindirectory (this option will work for all accounts).
Naturally, both options will only work if python 3 is already installed on the machine :)
As for sublime text 3 , @brutal_lobster provided the correct config. The only thing is that this config will work if there is a python3.3 file in /usr/bin/. If it is not there, the path must be absolute. For example like this:"cmd": ["/usr/bin/python3", "-u", "$file"],

S
Sly_tom_cat ., 2015-09-01
@Sly_tom_cat

If you do not understand what you are doing, then it is better not to use the instructions from the first answer.
Most Linux distributions (Ubuntu - especially) contain a bunch of utilities written in python2 and they will not work on python3 with a probability close to 100%. By replacing the python -> python2 link with python -> python3, you will get a very crooked system at best.
If you need the python program to be executed by the third python - just change
#!/usr/bin/env python in the first line of the program
to
#!/usr/bin/env python3

O
Oleg, 2014-01-25
@makol

Perhaps it will be useful en.wikisource.org/wiki/%D0%9F%D0%BE%D0%B3%D1%80%D1...
habrahabr.ru/post/167499

E
Evgeny Larin, 2016-01-01
@Larinn

Alternatively, install PyCharm and select the path to the interpreter of the required version in the settings, or write in the terminal:
Check the version
Change the version of the interpreter Check the version
again, make sure that it has changed The
disadvantage of this option is that you will have to write "alias" in each new terminal window "to run programs under the third version (if such a need suddenly arises), and after a reboot, respectively.
The screenshot below shows exactly where to choose the version of the interpreter in PyCharm.
-8_k-SQd_G4.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question