Debian – Install Python 3.6 on Debian8 Jessie

debianmakepython3

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.

Best Answer

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.

Related Question