2013-03-10 98 views
2

我按照http://nltk.org/install.html的說明操作。 我的python版本是2.7。安裝numpy,還有問題

當我嘗試這樣做:

sudo pip install -U numpy 

這並不工作:

File "numpy/core/setup.py", line 271, in check_types 

    "Cannot compile 'Python.h'. Perhaps you need to "\ 

SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel. 

任何想法幫助我嗎?

+4

也許你需要安裝'蟒蛇,dev'或'蟒蛇,devel'? – 2013-03-10 12:03:26

+0

哇!那麼,我從來沒有安裝過它們。我如何安裝它們? – 2013-03-10 12:04:29

+4

型'sudo易於得到在命令行 – User 2013-03-10 12:05:27

回答

3

正如指出的在評論User,在命令行中執行

sudo apt-get install python-dev 

會解決這個問題

+0

如果您在OSX中,該怎麼辦? – Ricardo 2014-06-09 15:14:15