Python build finished, but the necessary bits to build these modules were not found:
_bsddb _curses _curses_panel
_sqlite3 _ssl _tkinter
bsddb185 bz2 dbm
dl gdbm imageop
readline sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
可以看到最后一行有个建议,说是看一下setup.py是如何检查模块的。
if have_any_openssl:
if have_usable_openssl:
ssl_libs.append('/home/ap/xxxx/lib64')
# The _hashlib module wraps optimized implementations
# of hash functions from the OpenSSL library.
ssl_libs.append('/home/ap/xxxx/lib64') 这一行。
/home/ap/xxxx/src/packages/build/Python-2.7.6/./Modules/_ssl.c:1280: undefined reference to `SSL_get_error'
/home/ap/xxxx/lib/python2.7/config/libpython2.7.a(_ssl.o): In function `_ssl_threadid_callback':
/home/ap/xxxx/src/packages/build/Python-2.7.6/./Modules/_ssl.c:1661: undefined reference to `CRYPTO_THREADID_set_numeric'
collect2: ld returned 1 exit status
网上查了查,原来是 -lssl 没自动加进去。但是为什么没自动加进去呢?还是因为我把openssl装到了用户目录下。于是经过试验,可以在编译时添加一些环境变量来解决这一问题,编译命令如下: