1. 程式人生 > >CentOS安裝python3.5.0

CentOS安裝python3.5.0

prefix == ica build kernel pip3 ack ffi pen

1安裝編譯工具
yum install zlib-devel bzip2-devel openssl-devel python-devel kernel-devel libffi-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

2官網下載安裝
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz
解壓 tar -xvJf Python-3.5.0.tar.xz
cd Python-3.5.0
./configure prefix=/usr/local/python3
make && make install

3安裝pip3
1.首先安裝setuptools
  小夥伴們可以通過官方模塊庫來下載:https://pypi.python.org/pypi
  這裏我就直接用wget到服務器上下載了版本為19.6
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
tar -zxvf setuptools-19.6.tar.gz
cd setuptools-19.6
/usr/local/python3/bin/python3 setup.py build
/usr/local/python3/bin/python3 setup.py install
2.然後直接安裝pip就搞定了。。
  同樣先下載然後在執行命令搞定!!
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb
tar -zxvf pip-8.0.2.tar.gz
cd pip-8.0.2
/usr/local/python3/bin/python3 setup.py build
/usr/local/python3/bin/python3 setup.py install

3用pip安裝模塊
/usr/local/python3/bin/pip3 install Django==2.1.1

CentOS安裝python3.5.0