K
K
Kirill Petrov2016-08-31 08:46:35
Python
Kirill Petrov, 2016-08-31 08:46:35

Fallback from python3 to python2 in Debian Cinnamon environment?

Hello, I installed Python3 to work by default in debin, now the cinnamon settings do not open because they need Python2 (you can manually run it via bash).
I do

cinnamon-settings
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 31
except Exception , detail:
^
SyntaxError: invalid syntax

Through python2 everything is fine
python2 /usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py
Could not find bluetooth module; is the cinnamon-control-center package installed?
__init__ took 65.468 ms

Tried to do
sudo ln -s /usr/bin/python2.7 /usr/bin/python
[sudo] password for user:
ln: failed to create symbolic link '/usr/bin/python': File exists

How to get back?Thanks

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergei Nazarenko, 2016-08-31
@nazares

For the future, there is such a thing as the Virtual Environment, for python, you can use pyenv for example, etc.

# pyenv install 3.5.2  // установит python v. 3.5.2 
# pyenv install 2.7.12 // аналогично 
# pyenv global 2.7.12 // установит глобальное окружение с python v2.x
# pyenv local 3.5.2 // установит локальное окружение в текущем каталоге

etc.
Ps: In the future, this will save you from unnecessary hemorrhoids

C
chupasaurus, 2016-08-31
@chupasaurus

#update-alternatives set python /usr/bin/python version_number

K
Kirill Petrov, 2016-09-05
@dandyvssega

So in the end how do you do it?
I do

[email protected]:~$ sudo update-alternatives set python /usr/bin/python2.7
[sudo] password for user:
update-alternatives: error: unknown argument 'set'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question