我是 python 和 ubuntu 的新手。我正在尝试在 ubuntu 12.10 上安装 python 2.6.5。我已经有 python 2.7.3 并且正在尝试与现有的 python 并排安装 2.6.5。执行 make 时出现以下错误:
Failed to find the necessary bits to build these modules:
_bsddb bsddb185 dl
imageop linuxaudiodev ossaudiodev
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_curses _curses_panel _ssl
我最担心 _ssl 模块。如另一篇文章所述,我使用了 ./configure --with-ssl,但消息仍然相同。任何指针表示赞赏。
附加说明:make 曾经抱怨它也无法构建 bz2,但我通过重新编译 bzip2的这篇文章修复了这个问题。现在它归结为_ssl。我不确定我是否需要 _curses。
编辑:找到 make 日志文件,看起来这是由于 python 2.6.5 支持 ssl v2,而在 Ubuntu 中删除了这种支持。日志文件包含:
*** WARNING: renaming "_ssl" since importing it failed: build/lib.linux-x86_64-2./_ssl.so: undefined symbol: SSLv2_method
该博客在没有 ssl v2 支持的情况下重建了 python 2.6.8。我现在正在尝试他们在 2.6.5 源代码中的更改。
编辑 2:如上所述修改 2.6.5 源并删除 ssl v2 支持修复了 _ssl 模块未构建的问题。此外,这是我之前尝试安装的软件包列表:
apt-get install libreadline-dev
apt-get install libssl-dev (already installed)
apt-get install libbz2-dev (already installed)
apt-get install build-essential (already installed)
apt-get install sqlite3
apt-get install tk-dev
apt-get install libsqlite3-dev
apt-get install libc6-dev (already installed)
apt-get install libgdbm-dev
apt-get install libncursesw5-dev
这是make的完整输出:
running build
running build_ext
building '_curses' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict prototypes -I. -I/tmp/nimbula/Python-2.6.5/./Include -I. -IInclude -I./Include -I/usr/local/include -I/tmp/nimbula/Python-2.6.5/Include -I/tmp/nimbula/Python-2.6.5 -c /tmp/nimbula/Python-2.6.5/Modules/_cursesmodule.c -o build/temp.linux-x86_64-2.6/tmp/nimbula/Python-2.6.5/Modules/_cursesmodule.o
building '_curses_panel' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/tmp/nimbula/Python-2.6.5/./Include -I. -IInclude -I./Include -I/usr/local/include -I/tmp/nimbula/Python-2.6.5/Include -I/tmp/nimbula/Python-2.6.5 -c /tmp/nimbula/Python-2.6.5/Modules/_curses_panel.c -o build/temp.linux-x86_64-2.6/tmp/nimbula/Python-2.6.5/Modules/_curses_panel.o
Failed to find the necessary bits to build these modules:
_bsddb bsddb185 dl
imageop linuxaudiodev ossaudiodev
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_curses _curses_panel
running build_scripts
编辑3:是的,谢谢你们提出这些问题。当我查看我之前安装的软件包时,其中一个显然看起来不太好,libncursesw5-dev(因为它有一个版本,我从一篇旧帖子中得到它)。我尝试了以下方法,它解决了 _curses 和 _curses_panel 未构建的问题:
apt-get install libncurses-dev
安装 libncurses-dev 后,我执行了:make clean, ./configure --with-ssl, make。
现在 make 的输出是:
running build
running build_ext
Failed to find the necessary bits to build these modules:
_bsddb bsddb185 dl
imageop linuxaudiodev ossaudiodev
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
running build_scripts