How can I import neuron in an Python IDE under MSWin?

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

Moderator: hines

Post Reply
Aspen
Posts: 2
Joined: Mon Oct 29, 2007 9:20 am
Location: Zhejiang University,China

How can I import neuron in an Python IDE under MSWin?

Post by Aspen » Tue May 13, 2008 11:11 am

I tried to import neuron in Python(rather than in nrniv_python),but IDLE prompted an error, and I know it was because there was no neuron module. How can I fix the problem?
p.s. I used setup.exe to install NEURON rather than complied source code

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

Post by hines » Tue May 13, 2008 9:09 pm

At present, the setup.exe is limited to installing a version of NEURON that can
only be imported into a cygwin version of Python (i.e the same version of python
that the nrniv.exe program embeds.) Sadly, to import NEURON into a native mswin
build of Python you would need to build NEURON from the sources. This is done by
configuring with something like:
../nrn/configure --prefix=/home/hines/neuron/p25 --srcdir=/home/hines/neuron/nrn --with-nrnpython=/cygdrive/c/Python25/python
make
make mswin
which will compile under MinGW libraries. Such a build is most easily accomplished
with a full cygwin development environment.
Depending on whether you have Python2.4 or Python2.5 you would then move
the hocmodule.dll to the proper directory with the proper name. You can see why
I am currently only supporting embedding python via the setup.exe. At some point
in the future, and if the need to extend python on mswin becomes common, I will
provide a package for that purpose. Maybe someone would like to help me prepare
a proper egg or whatever it is called. At present I am unfamiliar with the proper
preparation of python modules or where to put them and how to invoke remote installation.

Aspen
Posts: 2
Joined: Mon Oct 29, 2007 9:20 am
Location: Zhejiang University,China

Post by Aspen » Wed May 14, 2008 9:21 am

Hello , hines
I followed your instruction,but I encountered 2 problems in the last step"make mswin". They are as follows:

1.cp: can't stat “/../bin/cygIVhines-3.dllâ€

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

Post by hines » Wed May 14, 2008 9:00 pm

[quote] 1.cp: can't stat “/../bin/cygIVhines-3.dllâ€

Post Reply