7

Debian8 comes with Python 3.4, but I need to install 3.6 version. I wonder is it possible at all? Cause I failed so many times.

I have tried options mentioned in (How to install Python 3.6), but for make -j8 step I get tons of the following errors:

libpython3.6m.alibpython3.6m.a((descrobject.ocompile.o))::  InIn  functionfunction `getset_get_doc':
/root/python3/Python-3.6.3/Objects/descrobject.c:438: undefined reference to `__gcov_indirect_call_profiler_v2'
/root/python3/Python-3.6.3/Objects/descrobject.c:438: undefined reference to `__gcov_indirect_call_callee'
/root/python3/Python-3.6.3/Objects/descrobject.c:438: undefined reference to `__gcov_time_profiler'
libpython3.6m.a(descrobject.o): In function `member_get_doc':
/root/python3/Python-3.6.3/Objects/descrobject.c:422: undefined reference to `__gcov_indirect_call_profiler_v2'
/root/python3/Python-3.6.3/Objects/descrobject.c:422: undefined reference to `__gcov_indirect_call_callee'
/root/python3/Python-3.6.3/Objects/descrobject.c:422: undefined reference to `__gcov_time_profiler'

and so on...

I don't want to use "http://ftp.de.debian.org/debian testing main" cause it contains experimental package and I'm not confident if that's right version to use on production.

I've also tried to do same thing with Debian 9, but had similar problems.

  • You can download the source of python 3.6 package from buster release and build the package. How to do it is described here: https://wiki.debian.org/BuildingTutorial

    Here you have the same question as your: https://unix.stackexchange.com/questions/332641/how-to-install-python-3-6

    – mariaczi Apr 04 '18 at 12:32

2 Answers2

5

I just had to do this, I find whenever I build python from source I have many issues (the 2 most annoying are not having a history when pressing the up key and getting an _sqlite module not available! Both can be fixed but it's just annoying having to fix them).

So to answer your question, the best way is to add Felix Krull's deadsnakes PPA at; https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa;

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6

There is also J Fernyhough's PPA at;
https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6;

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

Then rather than calling python3 we call python3.6


As Ubuntu is Debian based, and so long as you have a standard install adding Ubuntu PPA's has always worked out fine for me. I have used this on Linux Mint 18.1, 18.3, and a Debian version I fail to recall, but never had any issues.

  • That sounds exactly what I wanted. I will need to get another VPS to test this, cause I already set up production with Python 3.4 :D Thanks a lot. – Andrii Nikolaienko Apr 05 '18 at 15:53
  • 1
    Neither of the above PPAs worked for me. I got something similar to "W: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found" in both cases – Brian Peterson Jun 11 '18 at 16:48
  • Oh, woops, I let add-apt-repository command look for jessie in dists, when obviously ubunu doesn't have this. – Brian Peterson Jun 11 '18 at 16:50
  • 1
    They are not available for jessie. The oldest OS is trusty in both cases... – Alex Poca Jul 26 '18 at 09:14
  • 2
    @AlexPoca
    14.04 trusty = jessie / sid <<<--- trusty is jessie https://askubuntu.com/questions/445487/what-debian-version-are-the-different-ubuntu-versions-based-on .. besides that the point is that it installs - and works perfectly fine!
    – Jamie Lindsey Aug 17 '18 at 16:46
  • @JamieLindsey, damn, I completely missed this... Naming conventions in Linux world are a mistery to me... Thank you! – Alex Poca Aug 19 '18 at 16:42
2

It's worth noting that to add the PPA's, you will need the software-properties-common package installed.

Without this, you'll get:

bash: add-apt-repository: command not found

Or something similar. To fix this, simply run:

sudo apt-get install software-properties-common

And it'll install the add-apt-repository command for you!

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Jack_Hu
  • 241