On 5 Feb 2016, at 12:07, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
Yes David, I did mean firedrake/lib/python2.7/site-packages. Sorry about my typo.
Below I tried it again. You can see that I did active the virtualenv. You can also see my paths and that unfortunately the above path is not there. There are a lot of other paths but not the one that has a few of these modules.
OK, so *before* you activate the virtualenv, what do we have for: $ which python $ python -c "import sys; print sys.executable; print sys.path" I see something like: /usr/local/opt/python/bin/python2.7 ['', '/usr/local/lib/python2.7/site-packages/networkx-1.9.1-py2.7.egg', '/usr/local/lib/python2.7/site-packages/sphinxcontrib_youtube-1.0dev_20150105-py2.7.egg', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/lmitche1/Library/Python/2.7/lib/python/site-packages', '/usr/local/lib/python2.7/site-packages', '/usr/local/Cellar/numpy/1.10.1/libexec/nose/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages/gtk-2.0', '/Library/Python/2.7/site-packages']
Francis-Poulins-MacBook-Pro:software fpoulin$ source firedrake/bin/activate (firedrake)Francis-Poulins-MacBook-Pro:software fpoulin$ python
Now we've activated the virtualenv, so let's try again: $ which python $ python -c "import sys; print sys.executable; print sys.path" I hope these are different to before activation. If they are not, we need to figure out why.
When I am in virtualenv and I use sys.path does help. It finds petsc4py but not firedrake, because it can't find h5py.
sys.path.append("/Users/fpoulin/software/firedrake/lib/python2.7/site-packages")
I see that the following was installed.
/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/h5py-2.5.0-py2.7-macosx-10.10-x86_64.egg/
If everything is working well, then this /directory/ should have been added to python path. For example, in my case, in an activated virtualenv, I have: python -c "import sys; print sys.executable; print sys.path" /Users/lmitche1/tmp/firedrake/bin/python ['', '/Users/lmitche1/tmp/firedrake/lib/python2.7/site-packages/h5py-2.5.0-py2.7-macosx-10.10-x86_64.egg', '/Users/lmitche1/tmp/firedrake/lib/python27.zip', '/Users/lmitche1/tmp/firedrake/lib/python2.7', '/Users/lmitche1/tmp/firedrake/lib/python2.7/plat-darwin', '/Users/lmitche1/tmp/firedrake/lib/python2.7/plat-mac', '/Users/lmitche1/tmp/firedrake/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/lmitche1/tmp/firedrake/lib/python2.7/lib-tk', '/Users/lmitche1/tmp/firedrake/lib/python2.7/lib-old', '/Users/lmitche1/tmp/firedrake/lib/python2.7/lib-dynload', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/lmitche1/tmp/firedrake/lib/python2.7/site-packages'] Thanks, Lawrence