NEURON not working properly after update to Catalina and major troubleshooting!

Post Reply
sbrich
Posts: 26
Joined: Tue May 08, 2018 2:08 pm

NEURON not working properly after update to Catalina and major troubleshooting!

Post by sbrich » Thu Nov 21, 2019 12:36 pm

Hello all,

I am experiencing a very odd issue with NEURON after updating my Macbook Pro to the newest OS (Catalina).

At first, it appeared that something was awry with Python, so I went through a long and arduous process of uninstalling and reinstalling Anaconda (both versions 2 and 3). When this didn't appear to be working, I found this thread on the forum here: viewtopic.php?t=3806

After reading through that, and running

Code: Select all

unset PYTHONHOME
unset NRN_PYLIB
nrnpyenv.sh
multiple times, and using

Code: Select all

sudo nano $HOME/.bash_profile
to make the relevant changes, at the very minimum Python appears to be working (I can run "python" and "python3" from my Terminal and it appears to run... Anaconda still isn't working, but that's a separate issue potentially).

If I run nrngui from my home terminal window, it's also able to run. HOWEVER, as soon as I move to ANY different folder, particularly where my NEURON code is stored, this no longer works. In particular, if I run nrngui init_final.hoc (which opens the model I want to use) I get the following:

Code: Select all

/Users/scottrich/OneDrive - UHN/3) NEURON stuff/Human Cell/x86_64/special: line 13: /Applications/NEURON-7.6/nrn/x86_64/bin/nrniv: No such file or directory
If it is of importance, "python" and "python3" both still appear to be working in this new folder. Additionally, the output of running nrnpyenv.sh is the same:

Code: Select all

 nrnpyenv.sh
# PYTHON=/usr/bin/python3
# nrn_pylib from lsof: /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Python3
# items in sys.path = 7
# beginning with sys.prefix = 4
# site-3 same as sys.prefix
# in neither location ['.', '/Applications/NEURON-7.7/nrn/lib/python', '/Users/scottrich/OneDrive - UHN/3) NEURON stuff/Human Cell']
# sys.prefix = /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7
# site-3 = /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7

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

# if launch nrniv, then likely need:
export PYTHONHOME="/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7"
export NRN_PYLIB="/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Python3"
I'm at my absolute wits end trying to figure this out, and have exhausted essentially every troubleshooting resource available to me... and since I need access to my code (as I'm nearing the completion of a project) this issue is a major problem. Any help in fixing this would be GREATLY appreciated!

EDIT: I should have mentioned that I've also uninstalled and reinstalled NEURON multiple times, so I'm running NEURON 7.7

sbrich
Posts: 26
Joined: Tue May 08, 2018 2:08 pm

Re: NEURON not working properly after update to Catalina and major troubleshooting!

Post by sbrich » Thu Nov 21, 2019 1:01 pm

OK, so as always seems to be the case when it comes to tech troubleshooting, I seem to have made some progress after posting this. I reran nrnivmodl and tried again, and got a new error message:

Code: Select all

Mechanism CaDynamics_E2 needs to be re-translated.
It's version 7.5.0 "c" code is incompatible with this neuron version.
Here is what that CaDynamics_E2 code looks like (it doesn't seem to different from other .mod files I'm using:

Code: Select all

: Dynamics that track inside calcium concentration
: modified from Destexhe et al. 1994

NEURON	{
	SUFFIX CaDynamics_E2
	USEION ca READ ica WRITE cai
	RANGE decay, gamma, minCai, depth
}

UNITS	{
	(mV) = (millivolt)
	(mA) = (milliamp)
	FARADAY = (faraday) (coulombs)
	(molar) = (1/liter)
	(mM) = (millimolar)
	(um)	= (micron)
}

PARAMETER	{
	gamma = 0.05 : percent of free calcium (not buffered)
	decay = 80 (ms) : rate of removal of calcium
	depth = 0.1 (um) : depth of shell
	minCai = 1e-4 (mM)
}

ASSIGNED	{ica (mA/cm2)}

STATE	{
	cai (mM)
	}

BREAKPOINT	{ SOLVE states METHOD cnexp }

DERIVATIVE states	{
	cai' = -(10000)*(ica*gamma/(2*FARADAY*depth)) - (cai - minCai)/decay
}
So now I think my question may be a tad simpler: what needs to be fixed in this code so that it works in Neuron 7.7?

EDIT: Well now I just feel silly! I looked through some old posts on this issue and was able to fix it by deleting all the old .Io and .c files in my x86 folder, and redoing nrnivmodl. I'm not sure if it's worth keeping up this thread in case others have a similar issue and want to follow through my thought process or whether its worth removing now, but I'm 99% sure I've got things up and running!

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

Re: NEURON not working properly after update to Catalina and major troubleshooting!

Post by ted » Thu Nov 21, 2019 1:33 pm

Not related to the problem that triggered this thread, but something you need to know:
for your ODE-described calcium accumulation mechanism, use derivimplicit rather than cnexp. See
Integration methods for SOLVE statements viewtopic.php?f=28&t=592
in the Hot tips area of the Forum.

FYI your NMODL file is a repeat offender in this regard. Some problematical code just seems to keep coming back.

sbrich
Posts: 26
Joined: Tue May 08, 2018 2:08 pm

Re: NEURON not working properly after update to Catalina and major troubleshooting!

Post by sbrich » Thu Nov 21, 2019 1:37 pm

ted wrote:
Thu Nov 21, 2019 1:33 pm
Not related to the problem that triggered this thread, but something you need to know:
for your ODE-described calcium accumulation mechanism, use derivimplicit rather than cnexp. See
Integration methods for SOLVE statements viewtopic.php?f=28&t=592
in the Hot tips area of the Forum.

FYI your NMODL file is a repeat offender in this regard. Some problematical code just seems to keep coming back.
Thanks Ted! Yeah, that's a file that I took from a previous model and didn't create myself, but I will for sure keep that in mind going forward!

Post Reply