ImportError:无法导入名称pynestkernel

时间:2015-01-24 11:57:38

标签: python python-2.7

所以我昨晚花了很多时间尝试安装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'

2 个答案:

答案 0 :(得分:1)

尝试使用setuptoolsnest安装easy_install python-nest

答案 1 :(得分:0)

我正在尝试类似的东西,进一步的目标是让它使用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