[英]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
安裝nest
與easy_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.