2011-08-11 86 views
2

我已經在我的mac上安裝了帶有端口的scipy。它說一切都很好:端口在OSX中的安裝位置?

$ sudo port install py-scipy 
Password: 
---> Computing dependencies for py-scipy 
---> Cleaning py-scipy 

但是當我拉起蟒蛇,它不會看到它:

$ python2.6 
Python 2.6.7 (r267:88850, Jul 27 2011, 11:54:59) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import scipy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named scipy 

我的路徑包括端口位置我已經能夠在網上找到:

... '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info', ... 

事實上,我找不到沿着/ opt/local/Library/Frameworks等路徑安裝的任何scipy文件。

任何想法?

回答

3

要更改當前版本的Python到一個與MacPorts的安裝:

sudo port select python python26

這應該讓你使用Python有SciPy的安裝的版本MacPorts的。

0

欲瞭解更多關於macports.conf的信息,您將獲得所有信息。有關詳細信息,您還可以撥打man macports.conf

0

您安裝的Python模塊不在標準OS X版本的Python的搜索路徑中。當你使用MacPorts安裝Python模塊時,它將安裝它自己的Python版本。您可以開始使用使用select命令MacPort的版本:

sudo port select python python26 

另一種選擇是使用標準的Python的easy_install

進行安裝