Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upgrading to Python 3.5.2
#7
I dont remember which default python was on ubuntu 16.04. But you can really mess up your system by removing the wrong python version. Simply removing the default python can make it a nightmare to undo. Ive done this before and the easiest solution was to just reinstall linux as i kept digging myself deeper in the rabbit hole. AKA Removing python is a bad idea on linux unless you installed it in addition to the default python version. Ever since i just install the latest python version and make an alias to it to.

When you install a python version you can see the path it installed to via sys.path
$ python3.6
Python 3.6.1 (default, Jun  8 2017, 06:36:16) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/local/lib/python36.zip', '/usr/local/lib/python3.6', '/usr/local/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/site-packages']
If you look in that directory
metulburr@ubuntu:/usr/local/lib$ ls
libpython3.6m.a  pkgconfig  python2.7  python3.5  python3.6  python3.7
metulburr@ubuntu:~$ ls /usr/lib | grep python
python2.7
python3
python3.5
python3.6
python3.7
When you install a new linux version it doesnt replace the old one but makes a new directory. All you have to do is update the alias to the version you want, or just call the python version you want. Ive added python 3.5, 3.6, and 3.7 so i can safely remove those without messing up my system. sudo apt-get autoremove python3.6 and then make an alias to python3 for python3.7. However it doesnt really do anything by removing it. In fact i have so many 3rd party libraries installed to 3.6 i purposely will not remove it. The same may or may not be true to you.
Recommended Tutorials:
Reply


Messages In This Thread
Upgrading to Python 3.5.2 - by ErnestTBass - Jan-03-2019, 10:07 PM
RE: Upgrading to Python 3.5.2 - by nilamo - Jan-03-2019, 10:11 PM
RE: Upgrading to Python 3.5.2 - by metulburr - Jan-03-2019, 10:49 PM
RE: Upgrading to Python 3.5.2 - by ErnestTBass - Jan-04-2019, 05:46 PM
RE: Upgrading to Python 3.5.2 - by ErnestTBass - Jan-04-2019, 07:18 PM
RE: Upgrading to Python 3.5.2 - by snippsat - Jan-04-2019, 09:21 PM
RE: Upgrading to Python 3.5.2 - by metulburr - Jan-04-2019, 09:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Upgrading from 2 to 3 and having file write problems KenHorse 2 1,559 May-08-2022, 09:47 PM
Last Post: KenHorse
  Virtual environment and upgrading python 3.5 to 3.9 NeilUK 4 12,358 Jan-24-2021, 01:02 PM
Last Post: snippsat
  Error in Mysql Client when upgrading Django Abi 0 1,912 Sep-21-2020, 06:11 AM
Last Post: Abi
  Help with Upgrading to Python 3.8 KNSSCyberSec 1 2,459 Jan-31-2020, 08:37 PM
Last Post: Marbelous
  Pymssql library failing when upgrading to Python 3.7 - win32 issue stixmagiggins 5 7,610 Jun-24-2019, 06:46 AM
Last Post: snippsat
  error in upgrading python 24. to 2.7 singhraj3110 3 3,796 Jul-12-2018, 12:18 PM
Last Post: Larz60+
  upgrading google-api generates an error ineuw 3 3,814 Jul-07-2018, 06:47 AM
Last Post: ineuw
  upgrading python package amka 5 5,973 Nov-18-2017, 02:44 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020