今天在實驗室的ubuntu機子上安裝Eventlet,在安裝依賴包greenlet時出現錯誤,出現編譯錯誤。
錯誤如下:
In file included from greenlet.c:5:0:
greenlet.h:8:20: 致命錯誤: Python.h:沒有那個文件或目錄
編譯中斷。
error: Setup script exited with error: command 'gcc' failed with exit status 1
解決方法是安裝python-dev,這是Python的頭文件和靜態庫包:
sudo apt-get install python-dev