Python从2.7.5升级到3.6.5
学习了:https://blog.csdn.net/liang19890820/article/details/51079633
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar -zxvf Python-3.6.5.tgz
cd Python-3.6.5
./configure
make
sudo make install
sudo mv /usr/bin/python /usr/bin/python.bak
sudo ln -s /usr/local/bin/python3 /usr/bin/python
sudo vi /usr/bin/yum
sudo vi /usr/libexec/urlgrabber-ext-down
进行pip安装:
wget https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz
tar -zxvf pip-10.0.1.tar.gz
sudo python setup.py install
pip install requests
pip install pymysql
pip list
安装之后,pip list竟然没有对应的模块;
还是有问题的,需要指定python的版本:竟然直接运行还是不行的;
学习了:https://www.cnblogs.com/shabbylee/p/6792555.html
sudo python -m pip install requests
sudo python -m pip install pymysql
学习了:https://www.cnblogs.com/maoguy/p/6670988.html
-m表示以模块方式运行;
的确可以看出差别,用命令
python2 -m pip list显示出来的模块就要多一些;
而且用python2 进入命令行,可以import一些python3里面没有的模块;