2013-09-01 251 views
2

嘗試下載Pyspeckit(一個天文學程序)時,我需要獲取matplotlib才能正常工作。當我去嘗試,但是安裝matplotlib,cygwin的給我的錯誤:安裝pyspeckit時出現matplotlib錯誤

In file included from lib/matplotlib/tri/_tri.cpp:8:0: 
lib/matplotlib/tri/_tri.h:821:33: error: expected unqualified-id before numeric constant 
lib/matplotlib/tri/_tri.cpp: In constructor ‘RandomNumberGenerator::RandomNumberGenerator(long unsigned int)’: 
lib/matplotlib/tri/_tri.cpp:2180:28: error: expected identifier before numeric constant 
lib/matplotlib/tri/_tri.cpp:2180:28: error: expected ‘{’ before numeric constant 
lib/matplotlib/tri/_tri.cpp: At global scope: 
lib/matplotlib/tri/_tri.cpp:2180:28: error: expected unqualified-id before numeric constant 
error: command 'gcc' failed with exit status 1 

所以我不知道是否有人可能有一個解決的辦法?我通過Cygwin使用Python 2.7.3,所以使用安裝程序exe不會工作。

如果沒有,是否有可能指示我以某種方式從cygwin獲取類似天篷的東西,或者類似的包已經預裝了matplotlib?

謝謝你的時間。

+0

這些只是gcc編譯器錯誤,所以有可能是一些在C++代碼,GCC無法理解。嘗試查看它所說的錯誤代碼行,如果仍然無法獲取它,請使用C++標記發佈問題。 – Shashank

回答

3

我在Cygwin上遇到了與matplotlib相同的問題。

在第821行的lib/matplotlib/tri/_tri.h中定義了一個名爲「_C」的變量,並在第2180和2186行的tri.cpp中調用了該變量。出於某種原因,gcc不喜歡這樣一些架構中的保留字?)。我只是在tri.h和tri.cpp中將變量重命名爲「_Co」,並且編譯成功完成。

+0

這是否導致任何功能或任何損失? – Marcin

+0

還是你的意思是一致的重命名的所有用途?如果是這樣,是否只在內部引用該類? – Marcin

+0

不喪失功能。是的,重命名所有用途(這只是我提到的三個)。是的,我相信它只是在內部引用。 – murdertov