port 将其安装在 osx 中的哪里?
我已经在我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要将当前的 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.
有关更多信息,请搜索
macports.conf
,您将在那里获得所有信息。您还可以man macports.conf
了解一些详细信息。For more information search for
macports.conf
, you will have all the information there. You can alsoman macports.conf
for some details.您安装的 Python 模块不在标准 OS X 版本 Python 的搜索路径中。当您使用 MacPorts 安装 Python 模块时,它将安装它自己的 Python 版本。您可以使用
select
命令开始使用 MacPort 的版本:另一个选项是使用标准 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:Another option is to install it using the standard Python easy_install