problems with import mod mechanism with python
problems with import mod mechanism with python
Hi
I installed NEURON+python.
Now, when I compile the folder with the mod mechanisms using mknrndll, the nrnmech.dll file is created but the folder x86_64 is not created.
I think this is the reason why I cannot anymore import cell templete in hoc file from python.
Any suggestion?
Best,
Menica
I installed NEURON+python.
Now, when I compile the folder with the mod mechanisms using mknrndll, the nrnmech.dll file is created but the folder x86_64 is not created.
I think this is the reason why I cannot anymore import cell templete in hoc file from python.
Any suggestion?
Best,
Menica
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: problems with import mod mechanism with python
That is what mknrndll does.menica wrote:when I compile the folder with the mod mechanisms using mknrndll, the nrnmech.dll file is created
mknrndll does not create such a directory. All of the compiled mechanisms are in the nrnmech.dll file. If the nrnmech.dll file is in the current working directory when you start NEURON, it will automatically be loaded when NEURON starts, and a message like thisbut the folder x86_64 is not created.
Code: Select all
loading membrane mechanisms from . . .
Re: problems with import mod mechanism with python
Hi, I am typing in python
neuron.load_mechanisms('path_of_the_folder_where_mod_files_are')
and it returns as error:NEURON mechanisms not found in...
neuron.load_mechanisms('path_of_the_folder_where_mod_files_are')
and it returns as error:NEURON mechanisms not found in...
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: problems with import mod mechanism with python
Are you sure that the nrnmech.dll contains compiled mechanisms?
Are you sure that the path you specified is correct?
Are you sure that the path you specified is correct?
Re: problems with import mod mechanism with python
I think it is not created correctly even if when I run the mknrndll it returns :
nrnmech.dll was built successfully
I tried to use the same mechanisms calling them in neuron and indeed they are not compiled well.
The path I am using is correct
nrnmech.dll was built successfully
I tried to use the same mechanisms calling them in neuron and indeed they are not compiled well.
The path I am using is correct
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: problems with import mod mechanism with python
What happens when you launch nrngui in the directory where the nrnmech.dll exists? Exactly what does NEURON print to its terminal?menica wrote:I think it is not created correctly even if when I run the mknrndll it returns :
nrnmech.dll was built successfully
Re: problems with import mod mechanism with python
I tried to launch a hoc file directly from neuron with a compartment where I inserted the mechanism present in the same directory where the dll file is. On the terminal is printed:
NEURON -- Release 7.4 (1370:16a7055d4a86) 2015-11-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits
1
c:\nrn\bin\nrniv.exe: syntax error
in C:/Users/domenica.dibenedetto/Desktop/Shared folder-Kuramoto_model_in_NEURON
/GentilettiEtAl2016/simpcell.hoc near line 9
insert ikdrs
^
oc>
NEURON -- Release 7.4 (1370:16a7055d4a86) 2015-11-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
See http://www.neuron.yale.edu/neuron/credits
1
c:\nrn\bin\nrniv.exe: syntax error
in C:/Users/domenica.dibenedetto/Desktop/Shared folder-Kuramoto_model_in_NEURON
/GentilettiEtAl2016/simpcell.hoc near line 9
insert ikdrs
^
oc>
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: problems with import mod mechanism with python
First, uninstall the version of NEURON that is currently on that PC. Use the Uninstaller that comes with NEURON.
Download the most recent installer for MSWin
http://www.neuron.yale.edu/ftp/neuron/v ... -setup.exe
and use that to install NEURON.
Second, create a new directory that has a path that is much shorter and has no space characters.
C:/Users/domenica.dibenedetto/Desktop/test
would be good.
Third, create a hoc file called hello.hoc that contains only the following statement
print "hello"
and put it into the new directory.
Finally, use Windows Explorer to navigate to the new directory, and double click on hello.hoc
What does NEURON print to its terminal?
Download the most recent installer for MSWin
http://www.neuron.yale.edu/ftp/neuron/v ... -setup.exe
and use that to install NEURON.
Second, create a new directory that has a path that is much shorter and has no space characters.
C:/Users/domenica.dibenedetto/Desktop/test
would be good.
Third, create a hoc file called hello.hoc that contains only the following statement
print "hello"
and put it into the new directory.
Finally, use Windows Explorer to navigate to the new directory, and double click on hello.hoc
What does NEURON print to its terminal?
Re: problems with import mod mechanism with python
Hi,
I installed the new NEURON version and the "hello" is correctly printed.
But I have still the same problem in inserting the mechanisms and in compiling them properly.
When I use neuron with Python (downloaded with anaconda), it is able to import the gui, but I have still the same problem when I want to import the mechanisms.
Best
Menica
I installed the new NEURON version and the "hello" is correctly printed.
But I have still the same problem in inserting the mechanisms and in compiling them properly.
When I use neuron with Python (downloaded with anaconda), it is able to import the gui, but I have still the same problem when I want to import the mechanisms.
Best
Menica
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: problems with import mod mechanism with python
In the directory that contains hello.hoc, create a new file called dummy.mod that contains the followingmenica wrote:I installed the new NEURON version and the "hello" is correctly printed.
Code: Select all
: dummy.mod
: Makes a function written in C available to hoc
NEURON {
SUFFIX nothing
}
: call it gcosh to avoid naming conflicts
FUNCTION gcosh(z) {
gcosh = cosh(z)
}
After mknrndll is finished, does the directory contain a nrnmech.dll file?
Use NEURON to execute hello.hoc. Exactly what does NEURON print to its terminal?
Re: problems with import mod mechanism with python
Hi ,
yest the dll file is created, and when i run hello.hoc with neuron, this is what is printed :
NEURON -- VERSION 7.5 master (deea6c8) 2017-07-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits
hello
oc>
but I have still problem when I run .py file importing .mod mechanisms
yest the dll file is created, and when i run hello.hoc with neuron, this is what is printed :
NEURON -- VERSION 7.5 master (deea6c8) 2017-07-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits
hello
oc>
but I have still problem when I run .py file importing .mod mechanisms
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: problems with import mod mechanism with python
OK, if there is a nrnmech.dll file in the same directory as hello.hoc, then either the nrnmech.dll file is not being created correctly--exactly as you suspected back on August 4--or maybe NEURON isn't loading the nrnmech.dll file. What version of Windows are you using?
Re: problems with import mod mechanism with python
Since you now have
Date: Sun Apr 30 13:44:48 2017 -0400
Sometimes on mswin nrn_load_dll needs a full path to nrnmech.dll
This has been seen to happen with windows 10 and a recent version of enthought canopy.
Now the full path to the nrnmech.dll is automatically determined and used when nrn_load_dll is executed.
What we were expecting from the last test, is that before "hello" was printed, a line containing the text
"Loading membrane mechanisms from ...." should have been printed. Since nothing like that was printed
there was a very early failure of the default process of finding and loading the nrnmech.dll file. Please run the hello.hoc with neuron again and let
us know what is printed by
nrn_load_dll("nrnmech.dll")
I presume there is in fact a nrnmech.dll file in the same folder as hello.hoc. Can you also copy paste the output that contained the launch command.
it means your problem cannot be ascribed to a problem recently fixed. Ie.NEURON -- VERSION 7.5 master (deea6c8) 2017-07-09
Date: Sun Apr 30 13:44:48 2017 -0400
Sometimes on mswin nrn_load_dll needs a full path to nrnmech.dll
This has been seen to happen with windows 10 and a recent version of enthought canopy.
Now the full path to the nrnmech.dll is automatically determined and used when nrn_load_dll is executed.
What we were expecting from the last test, is that before "hello" was printed, a line containing the text
"Loading membrane mechanisms from ...." should have been printed. Since nothing like that was printed
there was a very early failure of the default process of finding and loading the nrnmech.dll file. Please run the hello.hoc with neuron again and let
us know what is printed by
nrn_load_dll("nrnmech.dll")
I presume there is in fact a nrnmech.dll file in the same folder as hello.hoc. Can you also copy paste the output that contained the launch command.
Re: problems with import mod mechanism with python
Hi ,
I have Windows 7.
the dll file is indeed not loaded correctly:
NEURON -- VERSION 7.5 master (deea6c8) 2017-07-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits
hello
oc>nrn_load_dll("nrnmech.dll")
0
oc>
I have Windows 7.
the dll file is indeed not loaded correctly:
NEURON -- VERSION 7.5 master (deea6c8) 2017-07-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits
hello
oc>nrn_load_dll("nrnmech.dll")
0
oc>