簡體   English   中英

如何在雪豹上安裝scipy,numpy和scikit-learn?

[英]How do I install scipy, numpy and scikit-learn on snow leopard?

我一直試圖用python 2.7在雪豹上安裝scipy,numpy和scikit-learn但到目前為止還沒有成功。

我能找到的只是Lion,我無法升級到。 我成功安裝了python 2.7,pip,virtualenv,virtualenvwrapper和numpy。 但是當我嘗試安裝scipy時,我收到了這個錯誤。

/var/folders/KU/KUY52WxPExK-Pljd3M-eV++++TM/-Tmp-//cc3jPxg5.s:3149:junk `@GOTPCREL' after expression

/var/folders/KU/KUY52WxPExK-Pljd3M-eV++++TM/-Tmp-//cc3jPxg5.s:3149:`___dso_handle@GOTPCREL(%rip)' is not a valid base/index expression

/var/folders/KU/KUY52WxPExK-Pljd3M-eV++++TM/-Tmp-//cc3jPxg5.s:3150:`__ZStL8__ioinit(%rip)' is not a valid base/index expression

/var/folders/KU/KUY52WxPExK-Pljd3M-eV++++TM/-Tmp-//cc3jPxg5.s:3151:junk `@GOTPCREL' after expression

/var/folders/KU/KUY52WxPExK-Pljd3M-eV++++TM/-Tmp-//cc3jPxg5.s:3151:`__ZNSt8ios_base4InitD1Ev@GOTPCREL(%rip)' is not a valid base/index expression

/var/folders/KU/KUY52WxPExK-Pljd3M-eV++++TM/-Tmp-//cc3jPxg5.s:3155:bad register name `%rsp'


error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -Iscipy/interpolate/src -I/Users/user/.virtualenvs/venv/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c scipy/interpolate/src/_interpolate.cpp -o build/temp.macosx-10.6-intel-2.7/scipy/interpolate/src/_interpolate.o" failed with exit status 1

我安裝了gcc和g ++ 4.2,我想我已經發現它應該是gcc,g ++ 4.0,我不知道如何安裝。

我應該怎樣做才能成功地對雪豹進行scipy,numpy和scikit-learn?

非常感謝。

編輯:我使用brew install python安裝python 2.7.3,我的雪豹上安裝了Xcode 4.2。 以上是我在嘗試安裝scipy時遇到的錯誤。

當我查看我的/ usr / bin時,我只有g++, g++-4.2

g ++也是4.2.1版

我也只安裝了Xcode 4.2,但設法在我的系統上找到了一個有效的gcc-4.0。 不確定它是如何實現的,但我想它是隨Xcode 4.2一起提供的。

因此,在安裝舊版Xcode之前,您可能需要檢查此位置是否有gcc-4.0:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/

我所做的只是運行:

export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0
export CXX=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.0
export ARCHFLAGS='-arch i386 -arch x86_64'

...在安裝scipy之前:

pip install scipy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM