PyNEURON will not load DLL files

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

Moderator: hines

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

PyNEURON will not load DLL files

Post by bscoventry » Wed Mar 27, 2013 1:51 pm

Hi all,

I am currently working on a model with many different user defined models. I am running Python xy with PyNeuron as a plug-in on a windows 7 machine. For some reason, I cannot get the dll file to load the user defined synaptic mechanisms. All mod files have been compiled with mknrndll. I have tried both the h.nrn_load_dll('file') and the load_mechanisms(directory), both of which do not work. In particular, the load_mechanisms returns the following results: NEURON mechanisms not found in C:/python27/Bartlett_Research/IC_Sustained_Model_v4. However, nrnmech.dll is most certainly located in that directory.

Any help would be greatly appreciated!

Brandon

ted
Site Admin
Posts: 5135
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: PyNEURON will not load DLL files

Post by ted » Wed Mar 27, 2013 2:37 pm

Which version of NEURON are you using?

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Wed Mar 27, 2013 2:43 pm

ted wrote:Which version of NEURON are you using?
Hi Ted,

I am using NEURON -- VERSION 7.2 (538+:81525c0e68a4+) 2011-08-26

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

Re: PyNEURON will not load DLL files

Post by hines » Wed Mar 27, 2013 3:41 pm

Instead of C:/pyt... try /c/pyt...

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

Re: PyNEURON will not load DLL files

Post by hines » Wed Mar 27, 2013 3:43 pm

I clicked submit too fast. It it is a mingw version you need /c/....
if you are using cygwin, you can try /cygdrive/c/...

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Thu Mar 28, 2013 2:00 pm

hines wrote:I clicked submit too fast. It it is a mingw version you need /c/....
if you are using cygwin, you can try /cygdrive/c/...
Still no luck. Actually, this is kind of weird, I have the mingw version, and the files were located in the cygdrive(didn't even have cygwin installed). I tried installing and working with cygwin, but no luck there either. I'm wondering if this is something inherent in PyNeuron

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

Re: PyNEURON will not load DLL files

Post by hines » Thu Mar 28, 2013 2:25 pm

In all the mentions of PyNEURON I was thinking NEURON. What is PyNEURON?

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Fri Mar 29, 2013 10:11 am

First of all, thank you so much for all your help.

Second, PyNeuron is the package I am using to run neuron as a module in Python. It can be found in the forums here: http://www.neuron.yale.edu/phpBB/viewto ... f=2&t=2501

Previously, these mod files were used in a model that ran in MATLAB/Hoc implementation, but we are trying to port to all Python.

Brandon

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

Re: PyNEURON will not load DLL files

Post by hines » Fri Mar 29, 2013 10:41 am

Ah yes. that jogs my memory. That is a great way to package NEURON and I should start maintaining it myself. However, let's see if the issue goes away by using
http://www.neuron.yale.edu/ftp/neuron/v ... -setup.exe
Or do you need a 32 bit version? (I can make one if needed).
After installation, there would only be a few manual tweaks so that you can launch Python and import neuron.
that is:
1) in /c/nrn73w64/bin64
cp hocmodule.dll hoc.pyd
That will allow "import hoc" when you are in that folder.
2)
export PYTHONPATH=/c/nrn73w64/lib/python:/c/nrn73w64/bin64
export NEURONHOME=/c/nrn73w64
that will allow import neuron from any location and make available the hoc standard library.

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Tue Apr 02, 2013 4:13 pm

Thank you so much. I may be being silly, but the link seems to be dead...

Brandon

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

Re: PyNEURON will not load DLL files

Post by hines » Tue Apr 02, 2013 4:37 pm

Since then , it has become the new standard distribution. See
http://www.neuron.yale.edu/neuron/download
or
http://www.neuron.yale.edu/ftp/neuron/versions/v7.3/

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Thu Apr 04, 2013 12:35 am

Ok cool!

Unforntunately the new version didn't help. I believe the Neuron module has it pre packaged and it does not use installed software. However, I did find something interesting. When I make the dll in the new version, I get the following results:

nrnmech.dll: skipped because wrong machine type

nrnmech.dll was created successfully.

Any idea what this means?

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

Re: PyNEURON will not load DLL files

Post by hines » Thu Apr 04, 2013 10:45 am

Ignore the "nrnmech.dll: skipped because wrong machine type". that has to do with rebasing for the 32 bit version.
Sounds like the dll was created successfully and when you 'import neuron' when you are in that folder, it should load the dll.

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Tue Apr 09, 2013 4:08 pm

RIght, thats what I thought, but I still can't get the user based mechanisms to load. I am certain that the nrnmech.dll is in the directory I am currently in when I load neuron. I'm not sure what else to try, so maybe I will contact Uri about this issue.

Thank you again for your time

bscoventry
Posts: 22
Joined: Tue Mar 26, 2013 2:07 pm

Re: PyNEURON will not load DLL files

Post by bscoventry » Tue Apr 09, 2013 4:45 pm

Hi all,

So, I just got an error that I've never gotten before, but seems pertinent to the question at hand:

LoadLibrary("nrnmech.dll") failed with error 193

This came up when I loaded neuron via import neuron.

Brandon

Post Reply