Python 无法在 Debian Lenny 上编译 _curses 模块
我在一些服务器上安装的 Python(2.6)已在没有我现在需要的 Curses 支持的情况下进行编译,尽管服务器安装了 libncurses5,但 Python 没有编译它的绑定,因此当我“导入 Curses”时,我得到:
"ImportError: No module named _curses"
我的 /lib/ dir 具有以下文件和符号链接:
lrwxrwxrwx 1 root root 17 2010-02-13 05:50 /lib/libncurses.so.5 -> libncurses.so.5.7
-rw-r--r-- 1 root root 251K 2008-12-14 22:31 /lib/libncurses.so.5.7
lrwxrwxrwx 1 root root 18 2010-02-13 05:50 /lib/libncursesw.so.5 -> libncursesw.so.5.7
-rw-r--r-- 1 root root 299K 2008-12-14 22:31 /lib/libncursesw.so.5.7
/lib64/ 具有:
lrwxrwxrwx 1 root root 20 2010-08-13 12:26 /lib64/libncurses.so -> /lib/libncurses.so.5
lrwxrwxrwx 1 root root 17 2010-02-13 05:50 /lib64/libncurses.so.5 -> libncurses.so.5.7
-rw-r--r-- 1 root root 251K 2008-12-14 22:31 /lib64/libncurses.so.5.7
lrwxrwxrwx 1 root root 18 2010-02-13 05:50 /lib64/libncursesw.so.5 -> libncursesw.so.5.7
-rw-r--r-- 1 root root 299K 2008-12-14 22:31 /lib64/libncursesw.so.5.7
/usr/lib64 和 /usr/lib 都具有:
lrwxrwxrwx 1 root root 20 2010-08-13 12:20 /usr/lib64/libncurses.so -> /lib/libncurses.so.5
当我再次尝试“make”python 时,我在最后收到以下警告:
Failed to find the necessary bits to build these modules:
_curses_panel _tkinter bsddb185
bz2 dl gdbm
imageop readline sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_curses
我该怎么办需要重新编译Python以支持curses吗?我在这里缺少什么?
谢谢!
My Python (2.6) installation on a few servers has been compiled without curses support which I now need, although the servers have libncurses5 installed, Python did not compile the bindings for it so when I "import curses" I get:
"ImportError: No module named _curses"
my /lib/ dir has the following files and symlinks:
lrwxrwxrwx 1 root root 17 2010-02-13 05:50 /lib/libncurses.so.5 -> libncurses.so.5.7
-rw-r--r-- 1 root root 251K 2008-12-14 22:31 /lib/libncurses.so.5.7
lrwxrwxrwx 1 root root 18 2010-02-13 05:50 /lib/libncursesw.so.5 -> libncursesw.so.5.7
-rw-r--r-- 1 root root 299K 2008-12-14 22:31 /lib/libncursesw.so.5.7
and /lib64/ has:
lrwxrwxrwx 1 root root 20 2010-08-13 12:26 /lib64/libncurses.so -> /lib/libncurses.so.5
lrwxrwxrwx 1 root root 17 2010-02-13 05:50 /lib64/libncurses.so.5 -> libncurses.so.5.7
-rw-r--r-- 1 root root 251K 2008-12-14 22:31 /lib64/libncurses.so.5.7
lrwxrwxrwx 1 root root 18 2010-02-13 05:50 /lib64/libncursesw.so.5 -> libncursesw.so.5.7
-rw-r--r-- 1 root root 299K 2008-12-14 22:31 /lib64/libncursesw.so.5.7
/usr/lib64 and /usr/lib both have have :
lrwxrwxrwx 1 root root 20 2010-08-13 12:20 /usr/lib64/libncurses.so -> /lib/libncurses.so.5
When I try to 'make' python again, I get back at the end the following warning:
Failed to find the necessary bits to build these modules:
_curses_panel _tkinter bsddb185
bz2 dl gdbm
imageop readline sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_curses
What do I need to do to recompile Python with curses support? What am I missing here?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,没错。安装 libncurses5-dev 并在
python
安装上运行'make'
和'make install'
就成功了。我在尝试在自定义 Python 安装上安装并启动bpython
时首先遇到了_curses
错误。Yes, that's right. Installing
libncurses5-dev
and running'make'
and'make install'
on thepython
installation did the trick. I had encountered the error with_curses
first while trying to install and fire upbpython
on my custom python installation.我不确定这些操作中的哪一个解决了我的问题,但其中一个确实解决了。我安装了 libncurses5-dev 和 libreadline5-dev,重新编译 python 并重新安装(make / make install)。
胡扎
I'm not sure which of these actions resolved my problem but one of them did. I installed libncurses5-dev and libreadline5-dev, recompiled python and reinstalled (make / make install).
Huzza
顺便说一句,在 CentOS 6.4 64 位上,您需要所有这些开发库来编译 Python 2.7.6:
在 yum install 后,运行 make ,还剩下四个模块:
根据此博文:
BTW, on CentOS 6.4 64-bit, you need all of these development libraries for compiling Python 2.7.6:
After
yum install
those, runmake
and there are four modules left:These are obsolete, according to this blog post: