0

as a little disclaimer I'm completely new to both Linux/Terminal and Python, so excuse the imprecise terminology

I'm trying to follow the basic usage guide for the python-based scientific calculator PyPhi, a dedicated tool for calculated integrated information in a network. I've followed the installation guide, in which I brew installed the latest versions of python and python3 (2.7.9 and 3.4.2 at the time of writing), pip installed virtualenvwrapper, changed the ~/.bash_profile as suggested to

## Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
export PATH=/usr/local/bin:$PATH

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/dev
source /usr/local/bin/virtualenvwrapper.sh

and also installed numpy for both 2.7.9 and 3.4.2. When I create a virtual environment using the command

mkvirtualenv -p `which python3` <name_of_your_project>

as suggested, I am able to import pyphi, but then attempting to import numpy as np brings up the error message

 File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'

This doesn't happen when I run python3 without a virtual environment, as I can import both pyphi and numpy. What's gone wrong with the virtualenvironment setup so that it doesn't work whilst in there?

2 Answers2

0

Please refer this question, I think, you've got similar problem. There are two ways: quick&dirty and proper. Choose your own.

By the way, did you try adding Frameworks directory for 3.4.2 to $PATH?

Community
  • 1
  • 1
vladfau
  • 1,003
  • 11
  • 22
0

PyPhi author here—it looks like you correctly created the virtual environment but didn't install the package while it was activated.

Make sure the virtual environment is active by running workon <name_of_your_project before running pip install pyphi.

Will
  • 4,241
  • 4
  • 39
  • 48