为什么 python 在 numpy.core.ma 上卡住了?

发布于 2024-10-31 05:38:02 字数 1999 浏览 2 评论 0原文

我正在尝试在我的 mac 10.6.7 32 位机器上设置 pylab;使用 virutalenv 将我正在做的事情与其他事情隔离开来(来自 ruby​​/rvm 背景,这只会让我感觉更好 - 但如果它不是“python 方式”,我愿意接受纠正)。

我安装了以下模块/库:

DateUtils-0.5.1-py2.7.egg-info  numpy-1.5.1-py2.7.egg-info
IPython             pip-0.8.3-py2.7.egg
configobj.py            pylab.py
configobj.pyc           pylab.pyc
dateutil                pymc
dateutils               pymc-2.1beta-py2.7.egg-info
easy-install.pth            python_dateutil-2.0-py2.7.egg-info
enthought               pytz
ipython-0.10.1-py2.7.egg-info   pytz-2011e-py2.7.egg-info
matplotlib              scipy
matplotlib-0.91.1-py2.7.egg-info    scipy-0.9.0-py2.7.egg-info
nose                setuptools-0.6c11-py2.7.egg
nose-1.0.0-py2.7.egg-info       setuptools-0.6c12dev_r88795-py2.7.egg
numpy               setuptools.pth

我唯一无法解释的是考虑;我从未安装过他们的 python 解决方案 - 必须是其他东西的依赖项。

Numpy 似乎工作得很好,matplotlib 可以毫无问题地导入;两者都来自外壳。当我调用普通的 ipython 时也没有问题。但是当我尝试使用 pylab 时,我的 python 在 numpy.core.ma 上卡住了,如下所示:

File "/Users/davidbgonzalez/.virtualenvs/VirtPy27/lib/python2.7/site-packages/matplotlib/numerix/ma/__init__.py", line 16, in <module>
from numpy.core.ma import *
ImportError: No module named ma

回到这里,我打开了 __init__.py 和一个提示,如 此处。果然,ma是在numpy.ma中找到的,而不是numpy.core.ma;通过 import numpy.ma 进行验证。

我更改了有问题的行:

from numpy.core.ma import * -> from numpy.ma import *

并得到一个新的、非常相似的错误:

File "/Users/davidbgonzalez/.virtualenvs/VirtPy27/lib/python2.7/site-packages/matplotlib/numerix/npyma/__init__.py", line 7, in <module>
from numpy.core.ma import *
ImportError: No module named ma

但是当我将 numpy.core.ma 的实例更改为 numpy.ma 时,我得到了一个可怕的结果:

Bus error

我愿意接受任何解决方案。

I'm trying to set up pylab on my mac 10.6.7 32 bit machine; using virutalenv to isolate what I'm doing from everything else (coming from a ruby/rvm background this just makes me feel better--but I'm open to correction if it's not the "python way").

I have the following modules/libs installed:

DateUtils-0.5.1-py2.7.egg-info  numpy-1.5.1-py2.7.egg-info
IPython             pip-0.8.3-py2.7.egg
configobj.py            pylab.py
configobj.pyc           pylab.pyc
dateutil                pymc
dateutils               pymc-2.1beta-py2.7.egg-info
easy-install.pth            python_dateutil-2.0-py2.7.egg-info
enthought               pytz
ipython-0.10.1-py2.7.egg-info   pytz-2011e-py2.7.egg-info
matplotlib              scipy
matplotlib-0.91.1-py2.7.egg-info    scipy-0.9.0-py2.7.egg-info
nose                setuptools-0.6c11-py2.7.egg
nose-1.0.0-py2.7.egg-info       setuptools-0.6c12dev_r88795-py2.7.egg
numpy               setuptools.pth

The only one I can't account for is enthought; I have never installed their python solution -must be a dependency of something else.

Numpy appears to be working just fine, matplotlib can be imported without issue; both from a shell. When I call just plain ipython no trouble either. But when I try and use pylab I python chokes on numpy.core.ma as in:

File "/Users/davidbgonzalez/.virtualenvs/VirtPy27/lib/python2.7/site-packages/matplotlib/numerix/ma/__init__.py", line 16, in <module>
from numpy.core.ma import *
ImportError: No module named ma

Backing into this I opened the __init__.py and a prompt as alluded to here. Sure enough, ma is found in numpy.ma not numpy.core.ma; verified via import numpy.ma.

I change the offending line:

from numpy.core.ma import * -> from numpy.ma import *

And get a new, very similar, error:

File "/Users/davidbgonzalez/.virtualenvs/VirtPy27/lib/python2.7/site-packages/matplotlib/numerix/npyma/__init__.py", line 7, in <module>
from numpy.core.ma import *
ImportError: No module named ma

But when I change that instance of numpy.core.ma to numpy.ma I get a dreadful:

Bus error

I'm open to any solutions.

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

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

发布评论

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

评论(2

明明#如月 2024-11-07 05:38:02

对于其他人来谷歌搜索,您当前搜索的一行是:

pip install -U 'http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz/download'

For someone else coming googling around, the one liner you search is currently:

pip install -U 'http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz/download'
雪若未夕 2024-11-07 05:38:02

您似乎安装了非常旧的 Matplotlib 版本。我不确定你从哪里得到它,但可以从 http://matplotlib 下载当前版本(1.0.1) .sourceforge.net/

You appear to have a extremely old version of Matplotlib installed. I'm not sure where you got it, but the current version (1.0.1) can be downloaded from http://matplotlib.sourceforge.net/

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