我通过将源代码安装到我的RHEL4框中来添加python 2.7.13作为altinstall
wget --no-check-certificate https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
tar -xvzf Python2.7.13.tar.xz
cd Python2.7.13
./configure --with-ensurepip=install
make
make test
make altinstall
Run Code Online (Sandbox Code Playgroud)
所以我不会覆盖其他用途所需的默认python.Python 2.7.13将成功安装但缺少我正在处理的项目的几个基本模块.
最初,_ssl和_haslib模块在本节中会出错.
Python build finished, but the necessary bits to build these modules were not found:
_bsddb _sqlite3 _tkinter
bsddb185 dbm dl
gdbm imageop sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Run Code Online (Sandbox Code Playgroud)
我安装了openssl并确保它们位于python正在寻找它们的默认位置,所以现在我有必要的位但是它以此消息结束
Failed to build these modules:
_hashlib _ssl
Run Code Online (Sandbox Code Playgroud)
下面是解python2.7 setup.py build压缩的python包的整个输出.我一直在搜索谷歌和我能找到的任何地方,但到目前为止,我一直没有成功
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or …Run Code Online (Sandbox Code Playgroud)