Error when running spaun2.0

I’m trying to run the spaun model available on github (GitHub - xchoo/spaun2.0: Spaun (nengo 2.0 version)). I already ran into some errors that I was able to fix thanks to an earlier post (Spaun 2.0 fails with "ModuleNotFoundError: No module named 'nengo.utils.compat'").

So after using nengo<3.0.0, python3.7, and numpy<=1.16.2, I ran into this error:

ImportError: /home/akl-ma/Downloads/spaun2.0-master/_spaun/arms/three_link/ undefined symbol: _Py_ZeroStruct

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 670, in
model = Spaun()
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/”, line 46, in Spaun = Motor()
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/modules/”, line 20, in init
File “/home/akl-ma/Dropbox/SpiNNcloud/spaun_2.0/spaun_venv/lib/python3.7/site-packages/nengo/utils/”, line 181, in call
self.wrapped, self.instance, args, kwargs)
File “/home/akl-ma/Dropbox/SpiNNcloud/spaun_2.0/spaun_venv/lib/python3.7/site-packages/nengo/utils/”, line 28, in with_self
return method(*args, **kwargs)
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/modules/”, line 101, in init_module
arm_obj = cfg.mtr_arm_class()
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/”, line 158, in mtr_arm_class
File “/usr/lib/python3.7/importlib/”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/arms/”, line 1, in
from .three_link.arm import Arm3Link
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/arms/three_link/”, line 1, in
from .arm import Arm3Link as Arm
File “/home/akl-ma/Downloads/spaun2.0-master/_spaun/arms/three_link/”, line 29, in
’ in %s and recompile the dll.’ % os.path.dirname(file))
ImportError: Error importing py3LinkArm python dll. Please read the README.txt in /home/akl-ma/Downloads/spaun2.0-master/_spaun/arms/three_link and recompile the dll.

I tried recompiling based on the insructions in the readme but then I ran into this error:

running build_ext
skipping ‘py3LinkArm.cpp’ Cython extension (up-to-date)
building ‘py3LinkArm’ extension
creating build
creating build/temp.linux-x86_64-3.7
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/akl-ma/Dropbox/SpiNNcloud/spaun_2.0/spaun_venv/lib/python3.7/site-packages/numpy/core/include -I/home/akl-ma/Dropbox/SpiNNcloud/spaun_2.0/spaun_venv/include -I/usr/include/python3.7m -c py3LinkArm.cpp -o build/temp.linux-x86_64-3.7/py3LinkArm.o
py3LinkArm.cpp:8:10: fatal error: pyconfig.h: No such file or directory
8 | #include “pyconfig.h”
| ^~~~~~~~~~~~
compilation terminated.

Any help is appreciated, thanks!

Hmmm. From the output, it looks like you are using a Python Venv (virtual environment)? I’m not too familiar with venvs as we typically use Conda (anaconda) as our Python environment manager.

A quick google of the error message seems to indicate that your system may be missing the development files necessary to compile the cpp code. Assuming you are using the system Python, something like this might resolve your issue:

sudo apt install python3-dev