繁体   English   中英

导入错误:无法导入名称 pynestkernel

[英]ImportError: cannot import name pynestkernel

所以我昨晚试图安装 nest(和 pynest)以与 PyNN 一起使用,但我目前被卡住了。 当我尝试导入嵌套时,我得到:

>>> 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安装nesteasy_install python-nest

我正在尝试类似的东西,进一步的目标是让它与 python 3 一起工作。到目前为止,我使用了以下命令:

git clone https://github.com/nest/nest-simulator.git
cd nest-simulator
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/nest -DPYTHON_EXECUTABLE=/usr/local/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/include/python3.5m -DPYTHON_LIBRARY=/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib .
make
make install

它运行没有错误,我可以愉快地运行嵌套。 我在运行 pyNN 时仍然遇到问题(参见http://blog.invibe.net/posts/2016-06-01-compiling-and-using-pynn-%2B-nest-%2B-python3.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM