3

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.

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 5 '18 at 15:53
  • Neither of the above PPAs worked for me. I got something similar to "W: Failed to fetch ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/jessie/main/… 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
  • They are not available for jessie. The oldest OS is trusty in both cases... – Alex Poca Jul 26 '18 at 9:14
  • 2
    @AlexPoca 14.04 trusty = jessie / sid <<<--- trusty is jessie askubuntu.com/questions/445487/… .. besides that the point is that it installs - and works perfectly fine! – Jamie Lindsey Aug 17 '18 at 16:46
1

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.