python - 导入错误: cannot import name pynestkernel

标签 python python-2.7 nest-simulator

所以我昨晚尝试安装 Nest(和 pynest)以与 PyNN 一起使用,但目前我陷入了困境。当我尝试导入 Nest 时,我得到:

>>> import nest
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nest/__init__.py", line 52, in <module>
    from . import pynestkernel as _kernel
ImportError: cannot import name pynestkernel

但是,当我进行 make installcheck 时,它通过了所有 pynest 测试。 我使用的是 OS x Yosemite,并且使用 macport 重新安装了 python 2.7.9。

尝试过:

easy_install python-nest

现在我收到一个新错误。

获取:

>>> import pyNN.nest as sim

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pyNN.nest as sim
  File "/Library/Python/2.7/site-packages/pyNN/nest/__init__.py", line 13, in <module>
from pyNN.nest import simulator
  File "/Library/Python/2.7/site-packages/pyNN/nest/simulator.py", line 500, in <module>
state = _State()  # a Singleton, so only a single instance ever exists
  File "/Library/Python/2.7/site-packages/pyNN/nest/simulator.py", line 60, in __init__
self._cache_num_processes = nest.GetKernelStatus()['num_processes'] # avoids blocking if only some nodes call num_processes
AttributeError: 'module' object has no attribute 'GetKernelStatus'

最佳答案

尝试使用setuptools通过easy_install python-nest安装nest

关于python - 导入错误: cannot import name pynestkernel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28125220/

相关文章:

python - 优化嵌入式 Python 解释器的大小

python - 拆分和连接后,我没有取回所有字符串

Python urllib2 错误

python - 巢模拟器 : python says “no module named nest”

python - Python套接字:Converting bytes object

python - 在字符串中查找子字符串旁边的所有分隔符并在 python 中替换

python - Mac OS X : upgrading from pip 18. 1 到 pip 19.1 更改了 python 版本 - 如何改回来?

linux - 如果 x > y 在 x 大于 y 的地方不起作用 python 2.7

python-3.x - 如何在 Ubuntu 18.04 上的 Python3 中安装 Nest