Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble with pip installation on a mac #274

Open
stephanie-r-jones opened this issue Jan 25, 2021 · 16 comments
Open

trouble with pip installation on a mac #274

stephanie-r-jones opened this issue Jan 25, 2021 · 16 comments

Comments

@stephanie-r-jones
Copy link
Member

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

@jasmainak
Copy link
Collaborator

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

@stephanie-r-jones
Copy link
Member Author

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?

@blakecaldwell
Copy link
Member

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.

@jasmainak
Copy link
Collaborator

yeah you need to unset $PYTHONPATH

@stephanie-r-jones
Copy link
Member Author

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
Copy link
Member Author

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 ?

@jasmainak
Copy link
Collaborator

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

@blakecaldwell
Copy link
Member

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.

@stephanie-r-jones
Copy link
Member Author

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
Copy link
Member Author

should I ignore this issue and continue with installation?

@blakecaldwell
Copy link
Member

blakecaldwell commented Jan 25, 2021

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

@stephanie-r-jones
Copy link
Member Author

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

@jasmainak
Copy link
Collaborator

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

@stephanie-r-jones
Copy link
Member Author

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
Copy link
Member Author

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 .

@blakecaldwell
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants