hnn icon indicating copy to clipboard operation
hnn copied to clipboard

trouble with pip installation on a mac

Open stephanie-r-jones opened this issue 4 years ago • 16 comments

I recently installed hnn_core and it broke my docker installation of HNN GUI

I am attempting the pip installation for mac I ran the prechecks and it appears Xquartz, NEURON, and python are all installed properly I ran $ conda create -y -n hnn python=3.7 openmpi pyqtgraph pyopengl matplotlib scipy psutil , and all seem to go well. I got to this step Screen Shot 2021-01-25 at 1 32 24 PM

I ran $source activate hnn , without issue I ran $pip install nlopt , and have an error.. I left of NEURON in this step because I think NEURON is installed properly

Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000010918d5c0 (most recent call first): Abort trap: 6

stephanie-r-jones avatar Jan 25 '21 18:01 stephanie-r-jones

since you are in a new environment, you need to run "pip install NEURON" again.

Also can you share what you get with:

$ which python
$ echo $PYTHONPATH

jasmainak avatar Jan 25 '21 18:01 jasmainak

pip install NEURON gave the same error ?

$which python produced /Applications/anaconda/envs/hnn/bin/python $echo $PYTHONPATH produced /Applications/NEURON-7.5/nrn/lib/python

perhaps this is the problem, there is no longer folder named Appllications/NEURON-7.5 on my computer.. I'm not sure why its point here?

stephanie-r-jones avatar Jan 25 '21 20:01 stephanie-r-jones

I recently installed hnn_core and it broke my docker installation of HNN GUI

Just to be clear, I think this is just the python install of HNN?

$which python produced /Applications/anaconda/envs/hnn/bin/python $echo $PYTHONPATH produced /Applications/NEURON-7.5/nrn/lib/python

perhaps this is the problem, there is no longer folder named Appllications/NEURON-7.5 on my computer.. I'm not sure why its point here?

Yeah, this makes sense. Old installs of NEURON had users add lines to the files ~/.bashrc or ~/.bash_profile. If you open up those files with a text editor and see a PYTHONPATH line, you can remove it. Also restart the terminal after making the change.

blakecaldwell avatar Jan 25 '21 20:01 blakecaldwell

yeah you need to unset $PYTHONPATH

jasmainak avatar Jan 25 '21 20:01 jasmainak

ok.. I did see that in both ~/.bashrc and ~/.bash_profile and removed that line from both now when I type $echo $PYTHONPATH I get /Applications/NEURON-7.8/lib/python Now $source activate hnn ... seems to be no problem here

However, I am getting the same error after I run $pip install nlopt NEURON

Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000010dd605c0 (most recent call first): Abort trap: 6

stephanie-r-jones avatar Jan 25 '21 20:01 stephanie-r-jones

And yes, I'm trying to install the python installation of HNN without a docker.. which as I understand, the python installation should run the GUI version ?

stephanie-r-jones avatar Jan 25 '21 20:01 stephanie-r-jones

you need to unset PYTHONPATH and PYTHONHOME. You are still getting /Applications/NEURON-7.8/lib/python when you do "echo $PYTHONPATH". It should return nothing ...

$ unset PYTHONPATH
$ unset PYTHONHOME

jasmainak avatar Jan 25 '21 20:01 jasmainak

And yes, I'm trying to install the python installation of HNN without a docker.. which as I understand, the python installation should run the GUI version ?

Yeah, it will (or should) once this issue is fixed.

blakecaldwell avatar Jan 25 '21 20:01 blakecaldwell

OK.. now we are getting somewhere... I was able to run $pip install nlopt NEURON

when I ran the check curl -s "https://raw.githubusercontent.com/jonescompneurolab/hnn/master/installer/mac/check-post.sh" | bash

It said PYTHONHOME is set. This is not recommended. Make sure that this is the correct environment to run HNN PYTHONHOME=/Applications/anaconda

PYTHONHOME is set. This is not recommended. Make sure that this is the correct environment to run HNN PYTHONHOME=/Applications/anaconda

I'm not sure why because I "unset PYTHONPATH", but I typed "PYTHONHOME=/Applications/anaconda" and this fixed that issue..

I'm also getting NRN_PYLIB is set. This is most likely not wanted and can prevent HNN from running if this file is missing or belongs to the wrong NEURON version. NRN_PYLIB=/Applications/anaconda/bin/../lib/libpython3.6m.dylib

and typing "NRN_PYLIB=/Applications/anaconda/bin/../lib/libpython3.6m.dylib " does not fix this issue ?

stephanie-r-jones avatar Jan 25 '21 21:01 stephanie-r-jones

should I ignore this issue and continue with installation?

stephanie-r-jones avatar Jan 25 '21 21:01 stephanie-r-jones

should I ignore this issue and continue with installation?

Yeah, that is okay to continue. It'll be best if you don't have any of those variables set. Using unset VARIABLE will always work for those 3 variables. If the check still contradicts what you know, then you can just ignore it.

If there are problems later after restarting terminal, then make sure none of those 3 variables are set in ~/.bash_profile or ~/.bashrc

blakecaldwell avatar Jan 25 '21 21:01 blakecaldwell

Ran into another snag, when I got to $ make The following error came up:

nrnivmodl mod Fatal Python error: initfsencoding: unable to load the file system codec ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000001152b15c0 (most recent call first): make: *** [x86_64/special] Abort trap: 6

stephanie-r-jones avatar Jan 26 '21 01:01 stephanie-r-jones

It looks like you have the PYTHONPATH/PYTHONHOME issue again. Can you make sure it's unset and try the command above again?

jasmainak avatar Jan 26 '21 02:01 jasmainak

Ok. I'm now up and running! I'm not sure why those paths didn't clear the first time, but they seem to be gone now and I'm up and running!

stephanie-r-jones avatar Jan 26 '21 14:01 stephanie-r-jones

Thanks for the help.

I suggest we add a note in the instructions to clear these paths before starting the installation procedure ,and make a note that if they had an earlier version of NEURON they may need to remove from ~/.bash_profile and ~/.bashrc .

stephanie-r-jones avatar Jan 26 '21 14:01 stephanie-r-jones

Changing ./bash_profile will no longer be recommended with the hnn-core integration release. So will close this when #282 gets merged.

blakecaldwell avatar Apr 01 '21 15:04 blakecaldwell