2010-08-13 48 views
2

在幾臺服務器上的Python(2.6)安裝已經被編譯出來,但是現在我需要curses支持,雖然服務器已經安裝了libncurses5,但Python並沒有爲它編譯綁定當我 「進口詛咒」 我得到:Python無法編譯Debian Lenny上的_curses模塊

"ImportError: No module named _curses" 

我的/ lib目錄/目錄有下列文件和符號鏈接:

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 

當我嘗試 '做' 了蟒蛇,我回來在最後以下警告:

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 

我需要做什麼才能用curses支持重新編譯Python?我在這裏錯過了什麼?

謝謝!

回答

1

我不確定哪些操作可以解決我的問題,但其中一個操作。我安裝了libncurses5-dev和libreadline5-dev,重新編譯python並重新安裝(make/make install)。 Huzza

4

是的,沒錯。在python安裝上安裝libncurses5-dev並運行'make''make install'就行了。我在嘗試安裝時觸發了_curses錯誤,並在我的自定義python安裝上觸發了bpython

1

順便說一句,在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

要查找必要的位,請在detect_modules()中查找模塊名稱的setup.py。

這些都是過時的,根據this blog post

sunaudiodev是是Sun的平臺,爲dl 32位平臺,imageop已被廢棄,bsddb185是未公開。