debian 8安装 python 3.6.3



wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar xvf Python-3.6.3.tgz
cd Python-3.6.3
./configure --enable-optimizations
make -j8
sudo make altinstall
python3.6

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

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

Common build problems

Some package need to be installed to avoid some known problems

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev   
sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm 
sudo apt-get install -y libncurses5-dev  libncursesw5-dev xz-utils tk-dev

The official recommendation is "you don't actually need newer software"

https://wiki.debian.org/DontBreakDebian#Don.27t_suffer_from_Shiny_New_Stuff_Syndrome

Most of the advice on that page is geared towards what to do if you want the software to be available system-wide, but I don't think that's necessary in this case.

If you fetch the python sources, build the 3.6 interpreter using --prefix to control where it ends up, and then use virtualenv with the --python option, then you can use python 3.6 without affecting anything outside your project.

The process might go something like this:

$ cd ~
$ mkdir pythonroot
$ mkdir opt
$ mkdir app
$ cd opt
$ wget <python tarball>
$ tar -xvf <python tarball>
$ cd python-3.6
$ ./configure --prefix="$HOME"/pythonroot
$ make
$ make install
$ cd ~
$ cd app
$ virtualenv venv --python ~/pythonroot/bin/python
$ . venv/bin/activate
[venv]$ which python
/home/<user>/pythonroot/bin/python
share improve this answer

https://unix.stackexchange.com/questions/332641/how-to-install-python-3-6


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值