linux源码安装python及pip和django

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
pip3 install --upgrade

3用pip安装模块

/usr/local/python3/bin/pip3 install Django==2.1.1
#/usr/local/python3/bin/pip3 install Django-2.1.1.tar.gz

 

posted @ 2019-08-25 21:38  linyouyi  阅读(1918)  评论(0编辑  收藏  举报