NEURON 7.6.7 - Permission denied. Python not available.

AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

Hello,

I'm trying to install NEURON 7.6.7 on my computer (windows 10 + python 3.8) to be able to use it with another simulation tool (not compatible with NEURON more recent versions).

First, I uninstalled NEURON 8.0 (I was previously using this version) and then I downloaded the exe file from here
https://neuron.yale.edu/ftp/neuron/versions/v7.6/7.6.7/. I followed the same steps I did for the installation of version 8.0, with which I was able to run simulations with python. However, I received the following error:

Code: Select all

 
C:\Users\amalu>nrniv -python
NEURON -- VERSION 7.6.7 7.6 (603da174) 2019-04-19
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2018
See http://neuron.yale.edu/neuron/credits
c:/nrn/bin/nrnpyenv.sh: line 141: /cygdrive/c/Users/amalu/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
Python not available
Could you please help me with this?

Best regards,
Ana Luís
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

nrnpyenv.sh has changed a bit over the past few years as it occasionally needs tweaking when new python installations become available.
I suggest the experiment of replacing c:\nrn\bin\nrnpyenv.sh with
https://github.com/neuronsimulator/nrn/ ... rnpyenv.sh

The purpose of the script is to figure out appropriate values for, e.g. on my linux desktop

export NRN_PYTHONHOME="/home/hines/.pyenv/versions/3.10.4"
export NRN_PYLIB="/home/hines/.pyenv/versions/3.10.4/lib/libpython3.10.so.1.0"

If you can figure out what those environment variables should be on your machine you can avoid the need for nrnpyenv.sh.
Note: if the above script does not work for your circumstance, it might be because it sometimes makes use of a small helper executable that
comes with the most recent versions of the NEURON setup.exe installer. If that is the case, you could figure out the two environment variables
by temporarily installing the most recent version of NEURON and determining the environment variables by opening a bash terminal and seeing the output of
nrnpyenv.sh
or
nrnpyenv.sh /full/path/to/your/desired/python.exe
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

First, thank you for the suggestions.

I tried to replace the nrnpyenv.sh by the one you suggested, but it gave an error.

Then I uninstalled NEURON 7.6.7 and installed the version 8.0.

The determined environment variables are the following:

export NRN_PYTHONHOME = "C:/Users/amalu/anaconda3"
export NRN_PYLIB = "C:/Users/amalu/anaconda3/python38.dll"

Now I'm not sure about the next step. Do I have to add these to the environment variable 'Path'? There I already have "C:\Users\amalu\anaconda3" and "C:\Users\amalu\anaconda3\Sripts".
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

I forgot to add that with NEURON 7.6.7 and with the updated nrnpyenv.sh the error is:

Code: Select all

Could not load libnrnpython38
pyver10=0 pylib=C:/Users/amalu/anaconda3/python38.dll
Python not available
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

If you use the bash terminal that is installed with NEURON, it suffices to copy/paste into that terminal window

Code: Select all

export NRN_PYTHONHOME = "C:/Users/amalu/anaconda3"
export NRN_PYLIB = "C:/Users/amalu/anaconda3/python38.dll"
And, by the way none of this is needed if you launch python instead of nrniv. It is possible to add the above environment variables "permanently" in your windows environment with the usual windows commands and syntax. I guess I'm not clear about the sequence of commands you use to launch nrniv. Are you double clicking an icon such as nrngui or neurondemo?

edit:

ok, looking at your original post I see you are using a windows command terminal (I guess :) So
On the Windows taskbar, right-click the Windows icon and select System. In the Settings window, under Related Settings, click Advanced system settings. On the Advanced tab, click Environment Variables. Click New to create a new environment variable.
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

I created 2 environment variables (advanced system settings > Environment Variables > New).

Code: Select all

Variable                                             Value
NRN_PYLIB                                                  C:\User\amalu\anaconda3\python38.dll

NRN_PYTHONHOME                                     C:\Users\amalu\anaconda3
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

I use the command 'nrniv -python.

I still get the same error, after adding the environment variables.

Code: Select all

Could not load libnrnpython38
pyver10=0 pylib=C:\Users\amalu\anaconda3\python38.dll
Python not available
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

try the following. Be careful about the distinction between / and \
Start a windows command line terminal and type

Code: Select all

nrniv
quit()
I just want to verify that you can launch nrniv but also get the error. Then

Code: Select all

set NRN_PYTHONHOME = C:/Users/amalu/anaconda3
set NRN_PYLIB = C:/Users/amalu/anaconda3/python38.dll
nrniv -python
from neuron import h
quit()
If that works you can go back to your

Code: Select all

Variable                                             Value
NRN_PYLIB                                                  C:\User\amalu\anaconda3\python38.dll

NRN_PYTHONHOME                                     C:\Users\amalu\anaconda3
and replace your backward slashes, \, with forward slashes. /
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

With the command 'nrniv' I receive the error message.

After doing the set commands, when I run 'nrniv -python' I also receive the same error message.

Sorry for the trouble, but I've been struggling with this for a while.
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

The syntax for set statements in a command prompt terminal does not allow spaces surrounding the '=' . I don't know how they crept into the code fragment above. Please try again in a command prompt the following

Code: Select all

set NRN_PYTHONHOME=C:/Users/amalu/anaconda3  
set NRN_PYLIB=C:/Users/amalu/anaconda3/python38.dll  
nrniv -python
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

I tried with no spaces and also with

Code: Select all

setx [variable_name] "[variable_value]"
, after which I got the message

Code: Select all

SUCCESS: Specified value was safe.
for both defined variables.

The error persists, but now refering to a different pylib directory (instead of conda python to another python version installed in Programs).

Code: Select all

Could not load libnrnpython/P
pyver10=0 pylib=C:/Users/amalu/AppData/Local/Programs/Python/Python38/python38.dll
Python not available
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

When you temporarily installed the most recent version of NEURON, were you able to successfully launch
nrniv -python
from a command prompt?
AnaLuis
Posts: 12
Joined: Mon May 16, 2022 5:25 am

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by AnaLuis »

Yes, I got this message but for version 8.0.

Code: Select all

NEURON -- VERSION 7.6.7-3-gef035d9b 7.6 (ef035d9b) 2019-04-28
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2018
See http://neuron.yale.edu/neuron/credits
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

i.e. nrn-7.6.7.w64-mingw-py-37-36-35-27-setup.exe

Sorry, it was staring me in the face the whole time. That installer does not have an interface dll for Python3.8
hines
Site Admin
Posts: 1655
Joined: Wed May 18, 2005 3:32 pm

Re: NEURON 7.6.7 - Permission denied. Python not available.

Post by hines »

Yes, I got this message but for version 8.0.

Code: Select all

NEURON -- VERSION 7.6.7-3-gef035d9b 7.6 (ef035d9b) 2019-04-28
That confuses me.I can't reconcile the "version 8.0" with the 7.6.7 banner.
Anyway,
I suppose it is potentially possible for me to rebuild a version of 7.6.7 that has a python 3.8 interface. Without trying, I don't know what effort that will be.
Is 7.6.7 somehow finding the version 8.0 python3.8 interface dll? I suppose that is conceivable.

Alternatively, I wonder if
another simulation tool (not compatible with NEURON more recent versions).
that problem can be overcome with less effort. I.e. can the incompatibility be described?
Post Reply