标签:linux
以下为在Ubuntu中python的基础环境安装一、python安装
1、基础开发库
sudo apt-get install gcc
sudo apt-get install openssl libssl-dev
2、安装数据库和开发库
sudo 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,方式如下:
sudo apt-get install python-setuptools
或者
下载地址:
https://pypi.python.org/pypi/setuptools方式如下:
unzip setuptools-39.2.0.zip
cd setuptools-39.2.0/
/opt/python2.7/bin/python ./setup.py install
四、pip安装
sudo apt-get install python-pip
或者
/opt/python2.7/bin/pip install -r ./requirements.txt
「自动化实战」手把手从python安装到setuptools、pip工具安装
标签:linux
原文地址:http://blog.51cto.com/tangyade/2118377