一、python安装
1、基础开发库
apt-get install gcc
apt-get install openssl libssl-dev
2、安装数据库和开发库
apt-get install mysql-server libmysqld-dev
3、python环境
下载地址:https://www.python.org/downloads/
tar -xvf Python-2.7.10.tar.xz
cd Python-2.7.10/
./configure --prefix=/opt/python2.7
make
make install
echo "export PATH=/opt/python2.7/bin:\$PATH" > /etc/profile.d/python.sh
echo $PATH
which python
mkdir ~/.python-eggs
chmod +w ~/.python-eggs
echo "export PATH=/opt/python2.7/bin:\$PATH" > /etc/profile.d/python.sh
export PATH=/opt/python2.7/bin:$PATH
二、setuptools安装
要使用easy_install工具,那么需要安装setuptools,方式如下:
下载地址:
https://pypi.python.org/pypi/setuptools
https://files.pythonhosted.org/packages/37/1b/b25507861991beeade31473868463dad0e58b1978c209de27384ae541b0b/setuptools-40.6.3.zip
方式如下:
unzip setuptools-28.8.0.zip
cd setuptools-28.8.0/
/opt/python2.7/bin/python ./setup.py install
四、pip安装
/opt/python2.7/bin/pip install -r ./requirements.txt
wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
python get-pip.py