I have recently for some unknown reason run into an error when trying to run my python script with NEURON. It seems as though python is not loading my nrnmech.dll file all of a sudden as I am receiving the below error:
Code: Select all
soma.insert('klt')
ValueError: argument not a density mechanism name.
- Making sure the nrnmech.dll file is created properly, I basically recreated nrnmech.dll and checked if I got any new errors in the terminal. Terminal said it was successfully created no errors.
- Checking if the nrnmech.dll is loaded in nrniv by running a .hoc file within the same directory, as you can see below this was a success.
Code: Select all
NEURON -- VERSION 7.8.2 release/7.8 (09b151ec) 2020-12-16 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2019 See http://neuron.yale.edu/neuron/credits loading membrane mechanisms from C:\Users\lizzy\Desktop\OCResearch\Neuroncode\Validation\yr2021\ExperimentalCheckFiles\ModFiles\nrnmech.dll Additional mechanisms from files hcnobo.mod ipulse1.mod ipulse2.mod ipulse3.mod jsrnaf.mod kht.mod klt.mod leak.mod vecevent.mod
- Uninstalling and reinstalling NEURON. I was previously using version 7.6.7, so I uninstalled it using the nrn uninstall.exe and then installed version 7.8.2. After which I reran the above two steps.
- I then made a simple model .py file just to debug the insert(mech) error and ran it and still same error for all the mechanisms I would like to insert that were compiled in nrnmech.dll. The code of the simple model in python is given below:
Code: Select all
"""This code is used to experiment with the NetCon Weight for the synaptic inputs.""" """Python Libraries:""" from neuron import h, gui """Load the NEURON MECHS:""" h.nrn_load_dll("C:/Users/lizzy/Desktop/OCResearch/Neuroncode/Validation/yr2021/ExperimentalCheckFiles/ModFiles") """Single Dendrite Octopus Cell:""" #Create OCell Sections: soma = h.Section(name = 'soma') dend = h.Section(name = 'dend') axon = h.Section(name = 'axon') #Define Topology: dend.connect(soma(0), 0) axon.connect(soma(1)) #Define Geometry of Sections: """Dendrite""" dend.diam = 3 #Diameter [um] dend.L = 250 #Length [um] dend.nseg = 21 #Number of Segments """Soma""" soma.diam = 25 #Diameter [um] soma.L = 25 #Length [um] soma.nseg = 1 #Number of Segments """Axon""" axon.diam = 3 #Diameter [um] axon.L = 32 #Length [um] axon.nseg = 1 #Number of Segments h.define_shape() #Define the Biophysics of each Section: for sec in h.allsec(): sec.Ra = 100 #Axial Resistance [ohm*cm] sec.cm = 0.9 #Membrane Capacitance [uF/cm^2] for sec in h.allsec(): if h.ismembrane("k_ion", sec=sec): sec.ek = -70 #Initial voltage membrane value for potassium ion channel if h.ismembrane("na_ion", sec=sec): sec.ena = 55 # mV (SPENCER ET AL) #Ena = 50 mV (ROTHMAN & MANIS) """Soma""" #Insert Soma biophysics soma.insert('klt') soma.insert('kht') soma.insert('jsrna') soma.insert('hcnobo') soma.insert('leak') # soma.insert('pas') soma.insert('extracellular') for seg in soma: seg.klt.gbar = 0.04070 seg.kht.gbar = 0.00 # Low Threshold Potassium conductance in S/cm2 seg.jsrna.gbar = 0.0 # Sodium conductance in S/cm2 seg.hcnobo.eh = -38 # Hyperpolarizaton potential in mV seg.hcnobo.gbar = 0.00 # Hyperpolarizaton conductance in S/cm2 seg.leak.gbar = 0.00 # Leak conductance in S/cm2 seg.leak.erev = -62 # seg.pas.e = -62 # seg.pas.g = 0.001 """Dendrite""" #Insert Dendrite biophysics dend.insert('klt') dend.insert('kht') dend.insert('jsrna') dend.insert('hcnobo') dend.insert('leak') # dend.insert('pas') dend.insert('extracellular') for seg in dend: seg.klt.gbar = 0.0027 seg.kht.gbar = 0.0000 # Low Threshold Potassium conductance in S/cm2 seg.jsrna.gbar = 0.0 # Sodium conductance in S/cm2 seg.hcnobo.eh = -38 # Hyperpolarizaton potential in mV seg.hcnobo.gbar = 0#0.0006 # Hyperpolarizaton conductance in S/cm2 seg.leak.gbar = 0#0.0020 # Leak conductance in S/cm2 seg.leak.erev = -62 # seg.pas.g = 0.001 # seg.pas.e = -62 """Axon""" #Insert Axon biophysics axon.insert('pas') axon.insert('extracellular') for seg in axon: seg.pas.g = 0.001 seg.pas.e = -62 h.topology() ps = h.PlotShape() # False tells h.PlotShape not to use NEURON's gui. Shows/draws the generated Octopus Cell. ps.show(0)
Any guidance in solving this particular issue will be greatly appreciated. In the meantime, I am going to see if there is not a windows 10 update that I need to do or undo.
Regards
Miss Stanley