port在哪里安装osx?

时间:2011-08-11 06:23:19

标签: python macos classpath port

我已经在我的mac上安装了scipy端口。它说一切都很好:

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

但是当我拉起python时,它看不到它:

$ 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 个答案:

答案 0 :(得分:3)

将当前版本的Python更改为随MacPorts安装的版本:

sudo port select python python26

这应该允许您使用已安装scipy的MacPorts版本的Python。

答案 1 :(得分:0)

有关macports.conf的更多信息,请在此处获取所有信息。您还可以man macports.conf了解一些详细信息。

答案 2 :(得分:0)

您安装的Python模块不在标准OS X版Python中的搜索路径中。当您使用MacPorts安装Python模块时,它将安装它自己的Python版本。您可以使用select命令开始使用MacPort的版本:

sudo port select python python26

另一个选择是使用标准Python easy_install

安装它