Page 1 of 1

nrngui failed as Py_Initialize exited

Posted: Tue Aug 05, 2014 8:15 pm
by figoyouwei
Dear Ted:

I just successfully installed NEURON with Python on the Mac OSX 10.9.4, everything works perfect under Python(2.7.8), but the nrngui doesn't seem to go and produces this error message, I tried different PYTHONHOMEs after examining that site.__file__, still no good.

Anything else I shall try ? And why is nrngui calling Python anyway ?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NEURON -- VERSION 7.4 (1135:0069222b746d) 0069222b746d
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2014
See http://www.neuron.yale.edu/neuron/credits

ImportError: No module named site
Py_Initialize exited. PYTHONHOME probably needs to be set correctly.
Our automatic guess based on the Python shared library location:
export PYTHONHOME=/usr
did not work.
It 'may' help to examine the output of:
python
import site
site.__file__

Re: nrngui failed as Py_Initialize exited

Posted: Tue Aug 05, 2014 8:36 pm
by ted
So you started Python, and at the >>> prompt, you executed

Code: Select all

import site
and then

Code: Select all

site.__file__
When you executed site.__file__ what did Python print?
I tried different PYTHONHOMEs after examining that site.__file__, still no good.
What PYTHONHOME did you try, and how did you try it?

Re: nrngui failed as Py_Initialize exited

Posted: Tue Aug 05, 2014 9:54 pm
by figoyouwei
site.__file__ prints out
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc'

so I tried:
export PYTHONHOME=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

Re: nrngui failed as Py_Initialize exited

Posted: Wed Aug 06, 2014 2:16 pm
by hines
site.__file__ prints out
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.pyc'
Please try
export PYTHONHOME=/Library/Frameworks/Python.framework/Versions/2.7

Re: nrngui failed as Py_Initialize exited

Posted: Wed Aug 06, 2014 2:25 pm
by hines
I should also mention that
nrngui -nopython
will also launch without initializing python. To make that permanent, you can create a $HOME/.nrn.defaults
(note the beginning '.' )file with the line
nopython: on

or you can put the above line in the /Applications/NEURON-7.3/nrn/share/nrn/lib/nrn.defaults
file (notice there in on beginning '.')

Re: nrngui failed as Py_Initialize exited

Posted: Wed Aug 06, 2014 5:24 pm
by figoyouwei
thank you !