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

PyNEURON will not load DLL files

Post by bscoventry »

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: 6289
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 »

Which version of NEURON are you using?
bscoventry

Re: PyNEURON will not load DLL files

Post by bscoventry »

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: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: PyNEURON will not load DLL files

Post by hines »

Instead of C:/pyt... try /c/pyt...
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: PyNEURON will not load DLL files

Post by hines »

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

Re: PyNEURON will not load DLL files

Post by bscoventry »

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: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: PyNEURON will not load DLL files

Post by hines »

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

Re: PyNEURON will not load DLL files

Post by bscoventry »

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: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: PyNEURON will not load DLL files

Post by hines »

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

Re: PyNEURON will not load DLL files

Post by bscoventry »

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

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

Re: PyNEURON will not load DLL files

Post by hines »

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

Re: PyNEURON will not load DLL files

Post by bscoventry »

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: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: PyNEURON will not load DLL files

Post by hines »

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

Re: PyNEURON will not load DLL files

Post by bscoventry »

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

Re: PyNEURON will not load DLL files

Post by bscoventry »

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