Running NEURON from Cygwin

Post Reply
Posts: 94
Joined: Mon Apr 20, 2009 7:02 pm

Running NEURON from Cygwin

Post by neuromau » Tue Jul 09, 2013 7:33 pm

Hi, I installed the precompiled 32-bit NEURON for Windows on a 64-bit Windows 7 Machine and added it to the path. Then, from the rxvt shell, I just enter 'nrniv' and it starts and runs my code fine. However, if I try to run it from the Cygwin terminal, when I enter nrniv, I get an error:
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013

Traceback (most recent call last):
File "/cygdrive/c/cygwin/lib/python2.7/", line 563, in <module>
File "/cygdrive/c/cygwin/lib/python2.7/", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/cygdrive/c/cygwin/lib/python2.7/", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/cygdrive/c/cygwin/lib/python2.7/", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/cygdrive/c/cygwin/lib/python2.7/", line 243, in getuserbase
USER_BASE = get_config_var('userbase')
File "/cygdrive/c/cygwin/lib/python2.7/", line 521, in get_config_var
return get_config_vars().get(name)
File "/cygdrive/c/cygwin/lib/python2.7/", line 420, in get_config_vars
File "/cygdrive/c/cygwin/lib/python2.7/", line 299, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /cygdrive/c/cygwin/include/python2.7/pyconfig.h (No such file or directory)
I tried installing Python after that, version 2.7.5 into the folder C:\Python27, but still got the same error. Do I need to reinstall NEURON after having installed Python? Why will it work in the rxvt shell but not the Cygwin shell? Ideally, I want to run a NEURON program using a system call from MATLAB, but right now that generates the same error as starting nrniv from the Cygwin shell.

Here's the other info from NEURON:
NEURON -- Release 7.3 (849:5be3d097b917) 2013-04-11
Release 7.3 (849:5be3d097b917)
'--prefix=/home/hines/neuron/nrnrelsetup' '--with-nrnpython' '--srcdir=/home/hines/neuron/nrn' '--with-paranrn'

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

Re: Running NEURON from Cygwin

Post by hines » Thu Jul 11, 2013 8:30 am

It is a puzzle to me why pyconfig.h is sometimes missing from the python installation.
On my machine pyconfig.h is located in /cygdrive/c/cygwin/usr/include/python2.7 . Assuming it is there also on your machine, I have no idea why is looking for it in /cygdrive/c/cygwin/include/python2.7
Anyway, there are at least two ways to avoid the problem.
nrniv -Py_NoSiteFlag ....
and copy the entire /cygdrive/c/cygwin/usr/include/python2.7 to ./cygdrive/c/cygwin/include

Note that when I run nrniv directly from a cygwin shell i need an explicit NEURONHOME environement variable. e.g.
export NEURONHOME=/cygdrive/c/nrn73

Posts: 94
Joined: Mon Apr 20, 2009 7:02 pm

Re: Running NEURON from Cygwin

Post by neuromau » Thu Jul 11, 2013 1:02 pm

Thanks, I will give those a try!

Posts: 94
Joined: Mon Apr 20, 2009 7:02 pm

Re: Running NEURON from Cygwin

Post by neuromau » Thu Jul 11, 2013 1:45 pm

Also, not sure if this is related, but if I try to run

Code: Select all

from the Cygwin terminal, even after exporting NEURONHOME, I get:
sh: /lib/ No such file or directory

But it works if I run that command from the rxvt shell.

Post Reply