ubuntu 14.04 升级python至3.6.5

首先前几天升级了ubuntu系统,数据太多没能备份,直接从12升级到14.04了,一切都点的是default,所以和原来配置一样。时间用了大概12个小时多,万幸没有丢数据。

接下来在系统中升级python2.7至3.6.5

参照的步骤:

https://blog.csdn.net/liang19890820/article/details/51079633

接下来用pip3安装numpy出现了问题:

Could not fetch URL https://pypi.python.org/simple/pool/: There was a problem confirming

可能是ssl证书没有认证。但是此时就出错了,显示本文开始提到的错误,大致意思就是安装过程需要SSL,但是那个SSL找不到。

进入python:

import ssl

出现问题:没有_ssl模块, # if we can't import it, let the error propagate

解决方法:

Since --with-ssl is not recognized anymore I just installed the libssl-dev:

扫描二维码关注公众号,回复: 3571787 查看本文章
sudo apt-get install libssl-dev 

To restart the make first clean up by:

make clean

Then start again and execute the following commands one after the other:

./configure
make
make test
make install

成功。

另一个问题:

ModuleNotFoundError: No module named '_bz2'

ubuntu解决方法: 

sudo apt-get install libbz2-dev 

然后转到python3.6.5目录下,./configure && make test && make && make install


发现一些所用代码的一些库只能在python2里,所以又装回python2,看了软链接的东西。

/usr/bin/python是软链接得到的。

猜你喜欢

转载自blog.csdn.net/Yansixiliang/article/details/80208072