centsos 下 python3 安装的坑

参考资料:

作者:风Boy
链接:https://www.jianshu.com/p/e2fc97b452de


今天在centos 7 下准备安装keras,准备安装python3 ,而后发生了一些问题,编译安装好后,需要对软连接进行处理。
删除旧连接,增加新链接。
还有改变yum的配置文件,默认的是python2.

准备使用easy_install 安装命令的时候出现了错误,

pkg_resources.VersionConflict: (setuptools 33.1.1 (/usr/local/python3/lib/python3.6/site-packages/setuptools-33.1.1-py3.6.egg), Requirement.parse('setuptools==0.9.8')) During handling of the above exception, another exception occurred: ... ... pkg_resources.DistributionNotFound: The 'setuptools==0.9.8' distribution was not found and is required by the application

安装好setuptool之后,还是报错

按照上面的作者那个方法,重新编译python,发现还是不行。

换用其他方法,自己觉得应该是pip的连接没有创建,于是后面又将软连接创建了。

但是创建连接之后,pip 可以使用,但是又出现了新的问题: 缺失ssh

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

于是又用yum安装open-ssh,openssl-devel。

安装好后,又来重新编译python。(应该是必须重新编译)

编译好后,pip install 可以使用 ,安装第三方库。

但是easy_install 还是用不了。

解决方法:
网上下一个setuptools工具,解压后进入解压目录
输入命令:

python  setup.py install 

之后创建软连接,保证可以在多个地方进行运行 easy_install 命令。