You can install Python-3.6 on Debian 8 as follows:

It is recommended to use make altinstall according to the official website.

If you want pip to be included, you need to add --with-ensurepip=install to your configure call. For more details see ./configure --help.

Warning: make install can overwrite or masquerade the python binary. make altinstall is therefore recommended instead of make install since it only installs exec_prefix/bin/pythonversion.

Some packages need to be installed to avoid some known problems, see: Common build problems(updated)


Alternative of libreadline-dev:

Fedora/CentOS/RHEL(aws ec2):

Alternative of openssl-devel:


You can download the latest python-x.y.z.tar.gz from here.

To set a default python version and easily switch between them , you need to update your update-alternatives with the multiple python version.

Let’s say you have installed the python3.7 on debian stretch , use the command whereis python to locate the binary (*/bin/python). e,g:

Add the python versions:

The python3.7 with the 50 priority is now your default python , the python -V will print:

To switch between them, use:

Sample output:



0 条评论


您的电子邮箱地址不会被公开。 必填项已用*标注