NEURON-6.2 rev 2195 apparently requires Python 2.5.2

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
sec6
Posts: 39
Joined: Sat Mar 15, 2008 10:32 am

NEURON-6.2 rev 2195 apparently requires Python 2.5.2

Post by sec6 » Sat Aug 23, 2008 11:47 pm

I checked out & built revision 2195, and, when I ran neuron with the -python switch, got this warning:

sys:1: RuntimeWarning: Python C API version mismatch for module nrn: This Python has API version 1012, module nrn has version 1013.

I was using Python 2.5.1
I installed Python 2.5.2 and the warning went away.

Mac users like myself should be aware that the version of Python supplied by Apple with OSX 10.5.2 is Python 2.5.1
(I don't know about 10.5.3) http://www.python.org/download/ 's Python2.5.2 installer for OSX installs to /Library/Frameworks/Python.framework, which is different from the native Python location in /System/Library/Frameworks/Python.framework -- however, NEURON seems to handle this transperantly. One still has to copy any modules (including numpy) into /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages

hines
Site Admin
Posts: 1573
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON-6.2 rev 2195 apparently requires Python 2.5.2

Post by hines » Sun Aug 24, 2008 8:40 pm

That is very strange since 2.5.1 also uses PYTHON_API_VERSION 1013
(see <python>/Include/modsupport.h)
It is probably not worth the effort to back out of your python2.5.2 installation and
trace the original problem. I don't know why, when you built with 2.5.1, that the
python library that got linked was a 2.3 or 2.4?
On my machine /usr/lib/python2.3/Include/modsupport.h PYTHON_API_VERSION is 1012
and /Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/modsupport.h
is also #define PYTHON_API_VERSION 1012


When I build a dmg distribution I use the configure option --with-nrnpython=dynamic
which builds 3 shared object interfaces and so one sees
/Applications/NEURON-6.2/nrn/umac/lib/libnrnpython23.dylib
libnrnpython24.dylib
libnrnpython25.dylib
(warning: I do not recommend the --with-nrnpython=dynamic option for user builds
but if you really need it, look at nrn/src/nrnpython/nrnpydnam.sh and do not
build with a -j option to make.)
When nrniv is launched, it attempts to load python 2.5, 2.4, 2.3 in that order and
the first that succeeds determines which libnrnpython is dynamically loaded.
Of course that elaboration is not needed when you build everything on your machine since the
build and runtime should be consistent. I do not know why, on your machine, it was not
consistent.

sec6
Posts: 39
Joined: Sat Mar 15, 2008 10:32 am

Re: NEURON-6.2 rev 2195 apparently requires Python 2.5.2

Post by sec6 » Mon Aug 25, 2008 5:51 pm

when you built with 2.5.1, that the python library that got linked was a 2.3 or 2.4?
Right, that's probably the explanation. Sorry.

I've got multiple copies of various versions of Python in various places, and have had problems before with NEURON finding the wrong one -- in particular 2.4 when I wanted 2.5. I think installing Python 2.5.2 may have fixed the problem because of *where* it was installed.

Post Reply