1、在新centos中安装python3的步骤
https://www.cnblogs.com/s-seven/p/9105973.html
https://www.cnblogs.com/lclq/archive/2016/06/27/5620196.html
2、安装python3过程中报错
no acceptable C compiler found in $PATH
参考
http://www.linuxidc.com/Linux/2013-04/82540.htm
yum -y install gcc
3、安装python3过程中保存:执行make install时
关键错误:zipimport.ZipImportError: can't decompress data
详细错误:
Traceback (most recent call last):
File "/root/Desktop/software/Python-3.6.4/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/root/Desktop/software/Python-3.6.4/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/root/Desktop/software/Python-3.6.4/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/root/Desktop/software/Python-3.6.4/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/root/Desktop/software/Python-3.6.4/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/root/Desktop/software/Python-3.6.4/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
参考
http://blog.csdn.net/u014749862/article/details/54430022
https://www.yuzhi100.com/article/centos-7-python37-no-module-named-ctypes
4、建立命令的快捷方式。和https://www.cnblogs.com/lclq/archive/2016/06/27/5620196.html教程有区别
python3
ln -s /usr/local/python/python3/bin/python3 /usr/bin/python3
pip3
ln -s /usr/local/python/python3/bin/pip3 /usr/bin/pip3
进入python的安装文件夹。执行
.configure --prefix=/usr/local/python3 && make && make install