1

So I spend last night trying to install nest (and pynest) to use with PyNN, and I am currently stuck. When I try to import nest I get:

>>> 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

However, when I make the make installcheck it passes all the pynest tests. I am using OS x Yosemite, and I did a new install of python 2.7.9 using macport.

Tried:

easy_install python-nest

Now I am getting a new error.

Getting:

>>> 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'
Robin De Schepper
  • 4,942
  • 4
  • 35
  • 56
Tiagojdferreira
  • 1,122
  • 2
  • 14
  • 20

2 Answers2

1

Try using setuptools to install nest with easy_install python-nest.

Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70
0

I am trying something similar, with the further goal of having it working with python 3. So far I used the following commands:

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

which runs without errors and I can happily run nest. Iam still having troubles running pyNN (see https://laurentperrinet.github.io/sciblog/posts/2016-06-01-compiling-and-using-pynn-%2B-nest-%2B-python3.html)

meduz
  • 3,903
  • 1
  • 28
  • 40