libnrnpython3 and libnrnpython2 on High Sierra

Post Reply
wpettine
Posts: 4
Joined: Fri Jan 05, 2018 11:12 am

libnrnpython3 and libnrnpython2 on High Sierra

Post by wpettine » Wed Jan 10, 2018 10:45 am

I am trying to install neuron on High Sierra and am running into an issue with libnrnpython3 and libnrnpython2. Specifically, it is showing the output below upon startup. It then cannot run neuron files.
NEURON -- VERSION 7.5 master (b14b5dd) 2017-12-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from /Applications/NEURON-7.5/nrn/share/nrn/demo/release/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod
Could not load either libnrnpython3 or libnrnpython2
pyver10=0 pylib=/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Prior to installation of neuron through the package, I installed the following dependencies
- Xquartz
- Command line tools
- open MPI
- Anaconda (I had a pre-existing full installation)

I tried installing from the package provided on the following link:
https://www.neuron.yale.edu/neuron/download

I also tried compiling based on the instructions given here:
https://www.neuron.yale.edu/neuron/down ... ilestd_osx

Furthermore, libnrnpython3 and libnrnpython2 both exist on my machine, and appear entirely intact.

Any suggestions?

hines
Site Admin
Posts: 1470
Joined: Wed May 18, 2005 3:32 pm

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by hines » Wed Jan 10, 2018 11:32 am

I'm a little confused by
NEURON -- VERSION 7.5 master (b14b5dd) 2017-12-21
because this change is later than the latest alpha distribution of
https://neuron.yale.edu/ftp/neuron/vers ... 64-osx.pkg
which is

Code: Select all

#define GIT_DATE "2017-12-07"
#define GIT_BRANCH "master"
#define GIT_CHANGESET "c693a84"
#define GIT_LOCAL "1670"
I don not recall distributing as a package...

Code: Select all

#define GIT_DATE "2017-12-21"
#define GIT_BRANCH "master"
#define GIT_CHANGESET "b14b5dd"
#define GIT_LOCAL "1673"
Anyway, perhaps the problem will go away if you download and install the above package since there was a fix to nrnpyenv.sh which is a bit
more robust. ie.
https://github.com/nrnhines/nrn/commit/ ... d678c72b4d
or download the nrnpyenv.sh from there and use it to replace your present version of that file (in /Applications/NEURON-7.5/nrn/x86_64/bin)

wpettine
Posts: 4
Joined: Fri Jan 05, 2018 11:12 am

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by wpettine » Tue Jan 16, 2018 3:34 pm

Thanks for the reply! I set it up to notify me with replies now, so will respond faster.

I think the line
NEURON -- VERSION 7.5 master (b14b5dd) 2017-12-21
probably had something to do with installing by compilation.

I tried replacing the file nrnpyenv.sh in the relevent folder and continued getting the error. I also deleted everything, and reinstalled from the package you recommended, and continue to get the error. Here's the output
-e
NEURON -- VERSION 7.5 master (c693a84) 2017-12-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from /Applications/NEURON-7.5/nrn/share/nrn/demo/release/x86_64/.libs/libnrnmech.so
Additional mechanisms from files
cabpump.mod cachan1.mod camchan.mod capump.mod invlfire.mod khhchan.mod mcna.mod nacaex.mod nachan.mod release.mod
Could not load either libnrnpython3 or libnrnpython2
pyver10=0 pylib=/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
oc>

hines
Site Admin
Posts: 1470
Joined: Wed May 18, 2005 3:32 pm

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by hines » Wed Jan 17, 2018 5:34 pm

running into an issue with libnrnpython3 and libnrnpython2
This caused me to leap to the conclusion that you had installed a package. I.e very few people use options like
--with-nrnpython=dynamic --with-pyexe=python3 --with-nrnpython-only
which are useful for making a python independent distribution
VERSION 7.5 master (b14b5dd) 2017-12-21
But this invalidated my conclusion since there was no such package distributed.
probably had something to do with installing by compilation.
So my advice about updating nrnpyenv.sh was flawed as you already had the most recent version.

Now that I'm on the same page as you, I need to ask how you configured the neuron build.
Also, what is the result if you
export PYTHONPATH=/Applications/NEURON-7.5/nrn/lib/python
python
from neuron import h.
Also, what is the result of
unset PYTHONHOME
unset NRN_PYLIB
nrnpyenv.sh

wpettine
Posts: 4
Joined: Fri Jan 05, 2018 11:12 am

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by wpettine » Thu Jan 18, 2018 9:08 am

Here's the output. Thanks again!
$ export PYTHONPATH=/Applications/NEURON-7.5/nrn/lib/python
$ python
Python 3.6.3 |Anaconda, Inc.| (default, Oct 6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
NEURON -- VERSION 7.5 master (c693a84) 2017-12-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

>>>
$ unset PYTHONHOME
$ unset NRN_PYLIP
$ nrnpyenv.sh
# nrn_pylib from PYLIB_DARWIN /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
# items in sys.path = 7
# beginning with sys.prefix = 5
# site-3 same as sys.prefix
# in neither location ['.', '/Applications/NEURON-7.5/nrn/lib/python']
# sys.prefix = /anaconda3
# site-3 = /anaconda3

# if launch python, then need:
export PYTHONPATH="/Applications/NEURON-7.5/nrn/lib/python"

# if launch nrniv, then likely need:
export PYTHONHOME="/anaconda3"
export NRN_PYLIB="/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"

hines
Site Admin
Posts: 1470
Joined: Wed May 18, 2005 3:32 pm

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by hines » Thu Jan 18, 2018 11:08 am

Ok. Thinks look right now as though it all should work. But you did not tell me what configure statement you used .
Also what do you get with
export PYTHONHOME="/anaconda3"
export NRN_PYLIB="/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
nrniv -python
from neuron import h


it may be that you problem was merely that the above variables did not make it into your environment. Note that instead of copying/pasting the
output of nrnpyenv.sh into your terminal you can also
source nrnpyenv.sh

Depending on the configure statement, you may not need NRN_PYLIB. The latter is generally needed only when --with-nrnpython=dynamic
is used.

wpettine
Posts: 4
Joined: Fri Jan 05, 2018 11:12 am

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by wpettine » Thu Jan 18, 2018 4:00 pm

Regarding the configure statement, for this install I just used the package you linked. Do you mean something else?
$ export PYTHONHOME="/anaconda3"
$ export NRN_PYLIB="/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
$ nrniv -python
NEURON -- VERSION 7.5 master (c693a84) 2017-12-07
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

Could not load either libnrnpython3 or libnrnpython2
pyver10=0 pylib=/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Python not available
As python didn't start, I was unable to run "from neuron import h"

hines
Site Admin
Posts: 1470
Joined: Wed May 18, 2005 3:32 pm

Re: libnrnpython3 and libnrnpython2 on High Sierra

Post by hines » Thu Jan 18, 2018 5:00 pm

Please send me the output from a terminal window of

Code: Select all

python
import os, subprocess
pid = os.getpid()
cmd = "lsof -p %d"%pid
f = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout
for bline in f:
    fields = bline.decode().split()
    if len(fields) > 8:
      print (fields[8])

email the output to michael.hines@yale.edu.

Post Reply