Python 无法在 Debian Lenny 上编译 _curses 模块

发布于 2024-09-14 02:32:48 字数 1668 浏览 15 评论 0原文

我在一些服务器上安装的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凯凯我们等你回来 2024-09-21 02:32:48

是的,没错。安装 libncurses5-dev 并在 python 安装上运行 'make''make install' 就成功了。我在尝试在自定义 Python 安装上安装并启动 bpython 时首先遇到了 _curses 错误。

Yes, that's right. Installing libncurses5-dev and running 'make' and 'make install' on the python installation did the trick. I had encountered the error with _curses first while trying to install and fire up bpython on my custom python installation.

左岸枫 2024-09-21 02:32:48

我不确定这些操作中的哪一个解决了我的问题,但其中一个确实解决了。我安装了 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

深爱不及久伴 2024-09-21 02:32:48

顺便说一句,在 CentOS 6.4 64 位上,您需要所有这些开发库来编译 Python 2.7.6:

yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel \
               ncurses-devel readline-devel gdbm-devel db4-devel tk-devel

在 yum install 后,运行 make ,还剩下四个模块:

Python 构建已完成,但未找到构建这些模块所需的位:

bsddb185 dl imageop sunaudiodev

要查找必要的位,请在 detector_modules() 中的 setup.py 中查找模块名称。

根据此博文

sunaudiodev 适用于 Sun 平台,dl 适用于 32 位平台,imageop 已弃用,bsddb185 未记录.

BTW, on CentOS 6.4 64-bit, you need all of these development libraries for compiling Python 2.7.6:

yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel \
               ncurses-devel readline-devel gdbm-devel db4-devel tk-devel

After yum install those, run make and there are four modules left:

Python build finished, but the necessary bits to build these modules were not found:

bsddb185 dl imageop sunaudiodev

To find the necessary bits, look in setup.py in detect_modules() for the module's name.

These are obsolete, according to this blog post:

sunaudiodev is is for Sun platforms, dl for 32bit platforms, imageop is deprecated and bsddb185 is undocumented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文