port 将其安装在 osx 中的哪里?

发布于 2024-11-28 18:45:06 字数 1634 浏览 2 评论 0原文

我已经在我的 mac 上安装了带有 port 的 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 任何地方的 scipy 文件/local/Library/Frameworks 等路径。

有什么想法吗?

I have installed scipy with port on my mac. it says all is fine:

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

but when i pull up python, it doesn't see it:

$ 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

My path includes the port locations i've been able to find online:

... '/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', ...

In fact I can't find scipy files installed anywhere along the /opt/local/Library/Frameworks etc path.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

纸短情长 2024-12-05 18:45:06

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

sudo port select python python26

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

To change your current version of Python to the one installed with MacPorts:

sudo port select python python26

This should let you use the MacPorts version of Python that has scipy installed.

不爱素颜 2024-12-05 18:45:06

有关更多信息,请搜索 macports.conf,您将在那里获得所有信息。您还可以 man macports.conf 了解一些详细信息。

For more information search for macports.conf, you will have all the information there. You can also man macports.conf for some details.

无声静候 2024-12-05 18:45:06

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

sudo port select python python26

另一个选项是使用标准 Python easy_install 来安装它

The Python module that you installed isn't in the search path of the standard OS X version of Python. When you install a Python module using MacPorts it will install it's own version of Python. You can start using MacPort's version using the select command:

sudo port select python python26

Another option is to install it using the standard Python easy_install

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文