Python 3.6.6 to Ubuntu 16.04.1?

12,040

The jonathonf PPA you are using has not included Python 3.6.6 yet. However, there is the deadsnakes PPA which is the de-facto standard for installing non-default Python versions on Ubuntu.

Run the following commands to start using the deadsnakes PPA:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update

You should be able to install Python 3.6.6 on your Ubuntu 16.04 after that.

Optionally remove the PPA “jonathonf” from your machine but this should not be necessary.

Note: I have python which associate to python2.7, python3 which associate to python3.5 and now I'm adding python3.6 - I don't want to overwrite other python installations.

The links python and python3 are system default. A new version added using a PPA should not alter these links, so they will still behave as the system expects. The Python version installed from the PPA should be available as python3.6.

But according to what I see they both go to /usr/lib/python3/dist-packages/.

These files are installed by the deadsnakes PPA:

$ dpkg -L python3.6
/.
/usr
/usr/lib
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/README.txt
/usr/bin
/usr/bin/2to3-3.6
/usr/bin/pydoc3.6
/usr/bin/pygettext3.6
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/python3.6
/usr/share/doc
/usr/share/doc/python3.6
/usr/share/doc/python3.6/NEWS.gz
/usr/share/doc/python3.6/README.rst.gz
/usr/share/doc/python3.6/ACKS.gz
/usr/share/doc/python3.6/README.Debian
/usr/share/doc/python3.6/copyright
/usr/share/doc/python3.6/changelog.Debian.gz
/usr/share/applications
/usr/share/applications/python3.6.desktop
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/2to3-3.6.1.gz
/usr/share/man/man1/pydoc3.6.1.gz
/usr/share/man/man1/pysetup3.6.1.gz
/usr/share/man/man1/pdb3.6.1.gz
/usr/share/man/man1/pygettext3.6.1.gz
/usr/share/pixmaps
/usr/share/pixmaps/python3.6.xpm
/usr/bin/pdb3.6
/usr/share/doc/python3.6/changelog.gz

The only thing going to the /usr/lib/python3/dist-packages directory is the README.txt file. It won’t overwrite current contents.

Share:
12,040

Related videos on Youtube

Programmer120
Author by

Programmer120

Updated on September 18, 2022

Comments

  • Programmer120
    Programmer120 over 1 year

    I'm using Ubuntu 16.04.1. I ran this commands:

    sudo apt-get update
    sudo apt-get install python3.6
    

    I upgraded my Python 3.6 from 3.6.2 to 3.6.5 But Python 3.6.6 is available since 2018-06-27 How can I install it? Does it make sense that such an important package is not in the repository?

    This important to me because 3.6.6 fixed a bug which I encounter in my code.

    Running apt-cache policy python3.6 Gives:

    python3.6:
      Installed: 3.6.5-5~16.04.york1
      Candidate: 3.6.5-5~16.04.york1
      Version table:
     *** 3.6.5-5~16.04.york1 500
            500 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
            100 /var/lib/dpkg/status
    

    I also get :

    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
        from apport.fileutils import likely_packaged, get_recent_crashes
      File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
        from apport.report import Report
      File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
        import apport.fileutils
      File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
        from apport.packaging_impl import impl as packaging
      File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
        import apt
      File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
        import apt_pkg
    ModuleNotFoundError: No module named 'apt_pkg'
    

    When running script using python3.6

    Note: I have python which associate to python2.7, python3 which associate to python3.5 and now I'm adding python3.6 - I don't want to overwrite other python installations.

  • Programmer120
    Programmer120 over 5 years
    can I have both 3.5 and 3.6 without mutual effect on each other?
  • Programmer120
    Programmer120 over 5 years
    But according to what I see they both go to /usr/lib/python3/dist-packages/ If I upgrade one package using python3.6 wouldn't it effect the python 3.5 ? The package is saved on the same place.
  • Melebius
    Melebius over 5 years
    @Programmer120 I tried to install Python3.6 from deadsnakes on one of my machines and it only added README.txt to the mentioned folder. It seems to be safe.
  • ambigus9
    ambigus9 about 4 years
    Worded! Thanks!