undefined symbol: nrnpython_start

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
Feanor
Posts: 26
Joined: Fri Nov 28, 2014 3:03 pm

undefined symbol: nrnpython_start

Post by Feanor »

Hello everyone,

I am trying to load compiled mechanisms with:

h.nrn_load_dll('./mod/x86_64/.libs/libnrnmech.so')

and am getting this error:

dlopen failed -
/usr/lib/x86_64-linux-gnu/libnrniv.so.0: undefined symbol: nrnpython_start

Anybody has an idea what this means and how to fix it? I read online that this could be another missing library. (I have installed the latest version of NEURON on Ubuntu.)

Thank you very much!

P. S. To clarity, I have put the mod files in a separate folder and try to load the compiled files from that location. Even if I have the mod files in the same level of the directory tree as the rest of the code and just use:

from neuron import h

instead of the function h.nrn_load_dll, I still get the same error.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: undefined symbol: nrnpython_start

Post by ted »

Even if I have the mod files in the same level of the directory tree as the rest of the code . . .
Please do this test.
Create a new directory.
Put your mod files in that directory.
In that directory execute
nrnivmodl
Then in that same directory execute
nrngui

What is the entire message that NEURON prints to the terminal?
Feanor
Posts: 26
Joined: Fri Nov 28, 2014 3:03 pm

Re: undefined symbol: nrnpython_start

Post by Feanor »

Hi Ted!

Thank you very much for your quick reply. Here is the output:

NEURON -- VERSION 7.6.3 master (85d62db) 2018-11-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2018
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from /home/daniel/Documents/PhD Studies/Work/Plasticity/Error Backprop/mod2/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
adaptive_AMPA.mod adaptive_cshom_AMPA.mod adaptive_cshom_NMDA.mod adaptive_glutamate2.mod adaptive_glutamate_crude.mod adaptive_glutamate_cshom.mod adaptive_glutamate_hom2.mod adaptive_glutamate_hom.mod adaptive_glutamate_hom_old.mod adaptive_glutamate.mod adaptive_glutamate_shom.mod adaptive_glutamate_test.mod adaptive_hom_AMPA.mod adaptive_hom_AMPA_old.mod adaptive_hom_NMDA2.mod adaptive_hom_NMDA.mod adaptive_hom_NMDA_old.mod adaptive_NMDAe.mod adaptive_NMDA.mod adaptive_shom_AMPA.mod adaptive_shom_NMDA.mod ampa.mod AMPA.mod AMPA_NMDA.mod AMPA_test.mod bk.mod cadyn.mod cadyn_nmda.mod cal12.mod cal13.mod caldyn.mod can.mod caq.mod car.mod cat32.mod cat33.mod cav32.mod cav33.mod expsyn_hom.mod gaba.mod generalized_rule.mod gigr.mod glu_length.mod glutamate_hom.mod glutamate_ica_nmda.mod glutamate.mod glutamate_mod.mod glutamate_sat.mod glutamate_steep.mod glutamate_test.mod Im.mod inhexp2syn.mod inhexpsyn.mod kaf.mod kas.mod kdr.mod kir.mod naf.mod nmda.mod NMDA.mod nmda_stp.mod NMDA_test.mod plateau_estimate.mod plateau_length.mod pregen.mod sk.mod tmglut.mod vecevent.mod v_filtered.mod
nrniv: unable to open font "*helvetica-medium-r-normal*--14*", using "fixed"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'neuron' has no attribute '_has_rxd'
oc>

This came with an additional crash report from Ubuntu that nrniv crashed, although the oc> prompt is still there afterwards. (This crash report doesn't show up every time I do nrngui.)

How does this output sound like? I notice that the NEURON version is 7.6.3, even though on NEURON's website 8.0 is the latest version. If this is relevant, I just installed Ubuntu 20 and right afterwards did "pip3 install neuron" as per the instructions on the webpage, and it seems it installed an earlier version?

Thanks again!
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: undefined symbol: nrnpython_start

Post by ted »

Thanks for your prompt response, but that's not "the entire message that NEURON prints to the terminal". The most important missing item is the first line, which reports details about the version of NEURON that you're using--just in case you're running into a bug that has already been fixed. Just execute
nrngui
at the linux command prompt. What does NEURON print to the terminal?

The message about helvetica isn't a problem. The message about rxd is important only if your model uses rxd or if one of your mod files contains something nonstandard (e.g. stuff in a Verbatim block) that makes a direct reference to rxd.

The path to your files contains spaces. That used to be a problem for NEURON, and I don't know if it has been fixed. Can you create a new directory in a location whose path has no spaces, copy your mod files to that, compile them with nrnivmodl, and then launch nrngui in the directory that contains the mod files?
Feanor
Posts: 26
Joined: Fri Nov 28, 2014 3:03 pm

Re: undefined symbol: nrnpython_start

Post by Feanor »

Hi again Ted!

It seems I have been editing the previous post while you were writing your answer. (I also realized while re-reading your first response that the entire output is not there and went on to edit the post to include NEURON's version. Also commented there that I installed NEURON according to the instructions on the website, expecting to install version 8.0. It seems it is different,)

The output with a path with no spaces is the same as the one above:

NEURON -- VERSION 7.6.3 master (85d62db) 2018-11-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2018
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from /home/daniel/Documents/PhD_Studies/Work/Plasticity/Error_Backprop/mod2/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
adaptive_AMPA.mod adaptive_cshom_AMPA.mod adaptive_cshom_NMDA.mod adaptive_glutamate2.mod adaptive_glutamate_crude.mod adaptive_glutamate_cshom.mod adaptive_glutamate_hom2.mod adaptive_glutamate_hom.mod adaptive_glutamate_hom_old.mod adaptive_glutamate.mod adaptive_glutamate_shom.mod adaptive_glutamate_test.mod adaptive_hom_AMPA.mod adaptive_hom_AMPA_old.mod adaptive_hom_NMDA2.mod adaptive_hom_NMDA.mod adaptive_hom_NMDA_old.mod adaptive_NMDAe.mod adaptive_NMDA.mod adaptive_shom_AMPA.mod adaptive_shom_NMDA.mod ampa.mod AMPA.mod AMPA_NMDA.mod AMPA_test.mod bk.mod cadyn.mod cadyn_nmda.mod cal12.mod cal13.mod caldyn.mod can.mod caq.mod car.mod cat32.mod cat33.mod cav32.mod cav33.mod expsyn_hom.mod gaba.mod generalized_rule.mod gigr.mod glu_length.mod glutamate_hom.mod glutamate_ica_nmda.mod glutamate.mod glutamate_mod.mod glutamate_sat.mod glutamate_steep.mod glutamate_test.mod Im.mod inhexp2syn.mod inhexpsyn.mod kaf.mod kas.mod kdr.mod kir.mod naf.mod nmda.mod NMDA.mod nmda_stp.mod NMDA_test.mod plateau_estimate.mod plateau_length.mod pregen.mod sk.mod tmglut.mod vecevent.mod v_filtered.mod
nrniv: unable to open font "*helvetica-medium-r-normal*--14*", using "fixed"
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'neuron' has no attribute '_has_rxd'

I would like to use rxd, so I suppose it would be good to solve that issue, as well. Maybe will be solved by installing the latest version?

Many thanks!
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: undefined symbol: nrnpython_start

Post by ted »

The output with a path with no spaces is the same as the one above
Right, but did NEURON still crash?

I just re-read your message from earlier today and realized the meaning of these sentences:
I notice that the NEURON version is 7.6.3, even though on NEURON's website 8.0 is the latest version. If this is relevant, I just installed Ubuntu 20 and right afterwards did "pip3 install neuron" as per the instructions on the webpage, and it seems it installed an earlier version?
That's very strange. There have been lots of bug fixes and performance improvements since 7.6.3; you're definitely going to want 8.

I just now did a pip3 install of NEURON into a fresh clone of Linux Mint 20.1, and what I got was absolutely NEURON 8

Code: Select all

ted@wisp:~$ pip3 install neuron
Collecting neuron
  Downloading NEURON-8.0.0-cp38-cp38-manylinux1_x86_64.whl (12.9 MB)
Collecting numpy>=1.9.3
  Downloading numpy-1.21.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.8 MB)
 . . .
Successfully installed neuron-8.0.0 numpy-1.21.2
after which

Code: Select all

ted@wisp:~$ nrngui
NEURON -- VERSION 8.0.0 HEAD (429d11ef) 2021-04-30
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2021
See http://neuron.yale.edu/neuron/credits
oc>
My guess is that 7.6.3 was already installed and in your PATH. The pip3 install of NEURON 8 has a directory structure that is very different from that produced by standard installs of previous versions--

Code: Select all

ted@wisp:~$ ls .local/bin/
f2py   f2py3.8  mkthreadsafe  neurondemo  nrniv      nrnpyenv.sh
f2py3  idraw    modlunit      nrngui      nrnivmodl  sortspike

ted@wisp:~$ locate nrngui
/home/ted/.local/bin/nrngui
/home/ted/.local/lib/python3.8/site-packages/neuron/.data/bin/nrngui
/home/ted/.local/lib/python3.8/site-packages/neuron/.data/share/nrn/lib/hoc/nrngui.hoc
/home/ted/.local/lib/python3.8/site-packages/neuron/.data/share/nrn/lib/hoc/nrngui1.hoc
If you see the same files on your machine, then

1. remove 7.6.3 from your PATH

2. make sure that your PATH starts with
/home/daniel/.local/bin:

and then you should be able to execute neuron by itself or use it as a Python module, and either way you'll be getting version 8.
Feanor
Posts: 26
Joined: Fri Nov 28, 2014 3:03 pm

Re: undefined symbol: nrnpython_start

Post by Feanor »

I installed Ubuntu 20 anew and I think I realized how an earlier version ended up getting installed. After installing NEURON with

Code: Select all

pip3 install neuron
I didn't add it to the path. At trying to compile mod files Ubuntu prompts me to install neuron-dev with sudo apt which was version 7.6.3. I must have done this and not remember it.

Anyway, now it's only NEURON 8.0 installed, and added to the path variable, and neither he dlopen error nor the rxd error are there anymore.

I am getting a different error, which should probably go in a separate post (let me know if I should open one). I am trying to load a morphology of a spiny projection neuron, the error that comes out is:

Code: Select all

error ./morphology/MSN_morphology_D1.swc line 2192: could not parse: 3002 2   7  60  0   0.5  3001
NEURON: Arg out of range in user function
 near line 0
 ^
        Import3d_Section[0].Matrix(3, 0)
      Import3d_Section[0].init(0, 0)
    Import3d_SWC_read[0].mksection(0, 0, 0)
  Import3d_SWC_read[0].mksections()
and others
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
~/Documents/PhD Studies/Work/Plasticity/Error Backprop/single_run.py in <module>
     24 cell_ID = 70
     25 variables = model_sets[cell_ID]['variables']
---> 26 cell = msn.MSN(variables = variables)
     27 
     28 for d in p.input_dends:

~/Documents/PhD Studies/Work/Plasticity/Error Backprop/d1msn.py in __init__(self, variables)
     21 class MSN(n.Neuron):
     22     def __init__(self, variables = None):
---> 23         self.create_morphology()
     24         self.insert_channels(variables)
     25         self.esyn = []

~/Documents/PhD Studies/Work/Plasticity/Error Backprop/d1msn.py in create_morphology(self)
     30     def create_morphology(self):
     31         Import = h.Import3d_SWC_read()
---> 32         Import.input(morphology)
     33         imprt = h.Import3d_GUI(Import, 0)
     34         imprt.instantiate(None)

RuntimeError: hoc error

I have cut the output and presented only the last error with the message "could not parse" (the first line in the output). The same error comes out for every line, they don't fit in a single post.

In the previous version of Ubuntu and NEURON that I used loading a morphology like this was not an issue. Maybe some necessary component is missing now after installing the most recent versions, or something has changed?

Thank you very much!
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: undefined symbol: nrnpython_start

Post by ted »

After installing NEURON with

Code: Select all

pip3 install neuron
I didn't add it to the path. At trying to compile mod files Ubuntu prompts me to install neuron-dev with sudo apt which was version 7.6.3.
How (not) helpful. Under Linux Mint (a close cousin of Ubuntu), pip install of NEURON simply adds .local/bin to PATH, and everything works properly without the user having to do anything to PATH.

IMO that 7.6.3 "neuron-dev" package should be purged from the planet. It wasn't properly configured in the first place, hasn't been maintained for years, and has reached the status of "the gift that keeps on giving," like tertiary syphilis.

WRT the swc file problem, please open a new thread for that. Also, it would be helpful if you could email me
ted dot carnevale at yale dot edu
the swc file that triggers the error message.
Feanor
Posts: 26
Joined: Fri Nov 28, 2014 3:03 pm

Re: undefined symbol: nrnpython_start

Post by Feanor »

How (not) helpful. Under Linux Mint (a close cousin of Ubuntu), pip install of NEURON simply adds .local/bin to PATH, and everything works properly without the user having to do anything to PATH.
Yes, I also got the impression that the user does not need to do anything after "pip3 install neuron".
IMO that 7.6.3 "neuron-dev" package should be purged from the planet. It wasn't properly configured in the first place, hasn't been maintained for years, and has reached the status of "the gift that keeps on giving," like tertiary syphilis.
After this description, so do I!

Thank you very much, I will open a new thread for the swc file and also email it to you.
Post Reply