Hi there Hines,
i've build NEURON with PYTHON support, therefore using:
import neuron
...
additional python NEURON code.
I'm using Python's functionality for embedding it into it with the high level Python API into C++:
http://docs.python.org/extending/embedding.html
Example is:
extern "C" {
#include <Python.h>
}
Py_Initialize();
PyRun_SimpleString("from neuron import h\n");
Py_Finalize();
But this fails with:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stephan/local/lib/python2.7/site-packages/neuron/__init__.py", line 81, in <module>
import neuron.hoc
ImportError: /home/stephan/neuron/nrn/x86_64/lib/libnrnpython.so.0: undefined symbol: PyExc_ImportError
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 16, in <module>
from xml.parsers.expat import ExpatError
File "/usr/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: _Py_ZeroStruct
Original exception was:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/stephan/local/lib/python2.7/site-packages/neuron/__init__.py", line 81, in <module>
import neuron.hoc
ImportError: /home/stephan/neuron/nrn/x86_64/lib/libnrnpython.so.0: undefined symbol: PyExc_ImportError
terminate called without an active exception
Aborted (core dumped)
Please note: invoking the Python interpreter in a Bash shell, and import neuron module works.
Let me know if you can suggest anything.
All the best,
Stephan