I have just started using PyNEURON and am having trouble using custom made .mod files.
The code I am running is simple, and inserts a mechanism called nad.mod
Code: Select all
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
PS C:\Users\lbriant> python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on wi
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
Found NEURON at C:\Python27\neuronhome
NEURON -- VERSION 7.2 (527+:a38b8d137de6+) 2011-07-26
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html
>>> h.chdir("C:/Python27/neuronhome/lib/hoc")
0.0
>>> h.load_file('stdrun.hoc')
1.0
>>> soma = h.Section(name='soma')
>>> dend = h.Section(name='dend')
>>> h.psection(sec=soma)
soma { nseg=1 L=100 Ra=35.4
/*location 0 attached to cell 0*/
/* First segment only */
insert morphology { diam=500}
insert capacitance { cm=1}
}
1.0
>>> dend.connect(soma(1))
<nrn.Section object at 0x01F551B8>
>>> h.psection(sec=dend)
dend { nseg=1 L=100 Ra=35.4
soma connect dend (0), 1
/* First segment only */
insert morphology { diam=500}
insert capacitance { cm=1}
}
1.0
>>>
>>> soma.L = soma.diam = 12.6157 # Makes a soma of 500 microns squared.
>>> dend.L = 200 # microns
>>> dend.diam = 1 # microns
>>>
>>> shape_window = h.PlotShape()
>>>
>>> for sec in h.allsec():
... sec.Ra = 100 # Axial resistance in Ohm * cm
... sec.cm = 1 # Membrane capacitance in micro Farads / cm^2
...
>>> # Insert active Hodgkin-Huxley current in the soma
... soma.insert('hh')
<nrn.Section object at 0x01F55230>
>>> soma.gnabar_hh = 0.12 # Sodium conductance in S/cm2
>>> soma.gkbar_hh = 0.036 # Potassium conductance in S/cm2
>>> soma.gl_hh = 0.0003 # Leak conductance in S/cm2
>>> soma.el_hh = -54.3 # Reversal potential in mV
>>> h.chdir("C:/example_cell/mod")
0.0
>>> soma.insert('nad')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: argument not a density mechanism name.
So then I change the directory to where the compiled nrnmech.dll file is, but when I type the following to load the nrnmech file I get the following error message:
Code: Select all
>>> h.nrn_load_dll("nrnmech.dll")
loading membrane mechanisms from nrnmech.dll
LoadLibrary("nrnmech.dll") failed with error 193
dlopen failed -
0.0
I am using Python 2.7.13 and Windows PowerShell on a Windows 8.1 Enterprise.
Thanks!
Linford