[Win64][7.4][Canopy] "dlopen failed" and python crash
Posted: Sat Jul 04, 2015 5:12 pm
Dear Hines/Ted/other fellows, I am having an error trying to load a .hoc file by load_file via the Python interface.
I installed the latest 7.4 stable release for win64 system and installed the win64 version Enthought Canopy Python. After setting NEURONHOME and PYTHONPATH to the corresponding directories, I was able to import neuron if I started Python in the bash terminal, but could not import neuron if I started the Python process elsewhere; this problem was solved using the method mentioned by hines here:
viewtopic.php?f=5&t=2604&hilit=DLL+load+failed&start=15
(page 2, bottom)
However, when I tried loading hoc files with h.load_file("filename.hoc") or h('load_file("filename.hoc")'), the message
"dlopen failed -"
will pop up, and windows will say "python.exe has stopped working". It happened both in the bash-initiated python and directly initiated pythons, and does not matter whether the .hoc file procedure involves GUI components. For some files, the error message would say
"loadlibrary("nrnmech.dll") failed with error 126"
, but I made sure to have all required cell mechanism were compiled and the nrnmech.dll file is in the same directory.
Another phenomenon I observed was that the "dlopen failed -" message does not pop immediately when I execute "import neuron" or assign h = neuron.h, but after I import neuron.gui or execute load_file.
I could not figure how to solve the problem and am quite frustrated by the repeated failure to implement Python-Neuron interface on a PC. Any help or suggestions would be greatly appreciated, and any modification that would fix the bug will be golden. Thanks.
I installed the latest 7.4 stable release for win64 system and installed the win64 version Enthought Canopy Python. After setting NEURONHOME and PYTHONPATH to the corresponding directories, I was able to import neuron if I started Python in the bash terminal, but could not import neuron if I started the Python process elsewhere; this problem was solved using the method mentioned by hines here:
viewtopic.php?f=5&t=2604&hilit=DLL+load+failed&start=15
(page 2, bottom)
However, when I tried loading hoc files with h.load_file("filename.hoc") or h('load_file("filename.hoc")'), the message
"dlopen failed -"
will pop up, and windows will say "python.exe has stopped working". It happened both in the bash-initiated python and directly initiated pythons, and does not matter whether the .hoc file procedure involves GUI components. For some files, the error message would say
"loadlibrary("nrnmech.dll") failed with error 126"
, but I made sure to have all required cell mechanism were compiled and the nrnmech.dll file is in the same directory.
Another phenomenon I observed was that the "dlopen failed -" message does not pop immediately when I execute "import neuron" or assign h = neuron.h, but after I import neuron.gui or execute load_file.
I could not figure how to solve the problem and am quite frustrated by the repeated failure to implement Python-Neuron interface on a PC. Any help or suggestions would be greatly appreciated, and any modification that would fix the bug will be golden. Thanks.