Upgrading python 3.5 to python 3.6 - Ubuntu
Solution 1
Following command worked for me:
sudo apt-get -f upgrade python3.6
Solution 2
follow below steps:-
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6
Solution 3
Answers here seem a bit out of date, mainly because the PPA no longer exists. This is what worked for me (relying on one of the links posted in some of the question comments, among others):
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6
(now we have both versions, need to switch the "toggle")
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 0
Mind the trailing 0
.
Related videos on Youtube
Shivkumar Mallesappa
Updated on June 04, 2022Comments
-
Shivkumar Mallesappa about 2 years
This is the first time I am working with python. I am using ubuntu 16.04 system. I am trying to change default python 3.5 to python 3.6 I am following this link to achieve this.
But I am getting the following error when I fire the command :
sudo update-alternatives --config python3
Error :
bash: /usr/bin/python3: Too many levels of symbolic links
Please refer the screenshot of the steps which I followed and the commands that are executed. I have first fired update and upgrade command.
I am not able to understand root cause of the issue, since I am new to python and its environment.
Thank you
-
Harsha Biyani almost 6 years
-
Bartłomiej almost 6 yearsThere is some circular symlink. See unix.stackexchange.com/q/141436/226403
-
Shivkumar Mallesappa almost 6 years@Bartłomiej : Thank you for your response. I understand that there is some issue with symlink , but I am not able to understand which symlink is causing this issue , which one I should use and which one I should remove. Could you please throw some light on this for me to understand this in a bit detail.
-
Bartłomiej almost 6 years@Shivkumar Mallesappa, Sorry, I do not know full solution, that is why I just put a comment, not an answer, hoping that it might be useful.
-
michael_heath almost 6 yearsThe link in the question has a update at the bottom of the article about removing and creating the symlink that causes issue.
update-alternatives
is possibly finding an invalid link so you may need to manually userm
andln
to fix. -
Kashif over 4 yearscheck this maybe helpfull for you stackoverflow.com/questions/21690009/…
-
-
Miron over 4 years
Cannot add PPA: 'ppa:~jonathonf/ubuntu/python-3.6'. ERROR: '~jonathonf' user or team does not exist.
This is all I see. -
Mohit Khandelwal about 4 yearsGot following error after running this command :
E: Unable to locate package python3.6