我需要在RHEL上安装几个Python模块,我没有root访问权限.至少有一个模块也需要访问Python.h.
在这种情况下,我发现最好的方法是安装python及其依赖项~/local.它通常只是工作,但这次Python无法构建SSL模块(请参阅下面的详细信息).这是我正在做的事情的痕迹.
所以我下载了python 6源码然后关闭了我:
./configure --prefix=/home/fds/rms/local
make >& make.log
Run Code Online (Sandbox Code Playgroud)
对日志的检查显示ssl模块尚未编译,但没有提及原因(make或configure中没有其他ssl出现):
Failed to find the necessary bits to build these modules:
_bsddb _curses _curses_panel
_hashlib _sqlite3 _ssl <----------
Run Code Online (Sandbox Code Playgroud)
所以我想,python根本找不到任何ssl库(这很奇怪,但是嘿......).所以我下载openssl-0.9.8r和
./config --prefix=/home/fds/rms/local shared
make
make install
Run Code Online (Sandbox Code Playgroud)
现在回到Python,我./configure并重新制作.它失败了,但这一次有所不同:
Failed to build these modules:
_hashlib _ssl
Run Code Online (Sandbox Code Playgroud)
仔细检查日志文件可以发现:
gcc -pthread -shared build/temp.linux-x86_64-2.6/home/fds/rms/installers/Python-2.6.6/Modules/_ssl.o -L/home/fds/rms/local/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-x86_64-2.6/_ssl.so
*** WARNING: renaming "_ssl" since importing it failed: libssl.so.0.9.8: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
所以现在它正在拿起图书馆,但不是很正确(文件应该在哪里):
$ find /home/fds/rms/local …Run Code Online (Sandbox Code Playgroud)