Contents

Linux编译安装Python3

1.Ubuntu or Debian

apt install libffi-dev libssl-dev libncurses5-dev

./configure --prefix=/usr/local/python3 --enable-optimizations

make && make install

2.RHEL or Centos

yum install libffi-devel.x86_64 openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc-c++

./configure --prefix=/usr/local/python3 --enable-optimizations

make && make install

3.Python Pip配置

mkdir -pv ~/.pip/

1
2
3
4
# ~/.pip/pip.conf                                                                                          
[global]
trusted-host=mirrors.aliyun.com
index-url=https://mirrors.aliyun.com/pypi/simple/

4. 有了Conda之后还是Conda大法好

1
2
3
4
5
6
7
8
# ~/.condarc 

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
ssl_verify: true
show_channel_urls: true
changeps1: False

4.1.常用coda命令

1
2
3
#conda
conda env list
conda create --name py37 python=3.7 

5.主流Python版本维护周期

Python version Maintenance status First released End of support
3.9 bugfix 2020-10-05 2025-10
3.8 bugfix 2019-10-14 2024-10
3.7 security 2018-06-27 2023-06-27
3.6 security 2016-12-23 2021-12-23
2.7 end-of-life 2010-07-03 2020-01-01