我正在添加python 2.7.13作为altinstall,方法是将源代码安装到RHEL4框中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
这样我就不会覆盖其他使用所需的默认python。Python2.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.
我安装了openssl,并确保它们位于python查找它们的默认位置,所以现在我有了必要的位,但是它以下面的消息结尾Failed to build these modules:
_hashlib _ssl
下面是解压缩的python包中python2.7 setup.py build的全部输出。我一直在搜索谷歌和任何我能找到的地方,但到目前为止我在任何事情上都没有成功running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_ssl' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/ssl/include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/include/python2.7 -c /Python/Modules/_ssl.c -o build/temp.linux-x86_64-2.7/Python/Modules/_ssl.o
/Python/Modules/_ssl.c:57: warnin