centos系统下安装python2.7
1.yum install gcc gcc-c++ make cmake -y
2.yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
3.wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
4.tar -xzvf Python-2.7.13.tgz
5.cd Python-2.7.13
6. ./configure
7. make && make install
8. cd /usr/bin/
9. mv python python.old
10. ln -s /usr/local/bin/python python
11. ln -s /usr/local/bin/python-config python-config
12. ln -s /usr/local/include/python2.7/ /usr/include/python2.7
13. python –version
14. wget https://bootstrap.pypa.io/ez_setup.py -O - | python
15. python ez_setup.py
16. easy_install pip
17. pip install pymysql
18. pip install Scrapy
ubuntu
apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev
pip install –upgrade scrapy
pip install –upgrade twisted
pip install –upgrade pyopenssl
pip install –upgrade pip enum34
rm -rf /Library/Python/2.7/site-packages/six*
rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six*
pip install six