Re: [firedrake] upgrading firedrake (problem found!)
On Fri, 5 Feb 2016 at 03:29 Francis Poulin <fpoulin@uwaterloo.ca> wrote:
I have set my default python and ipython to my homebrew version. (don't think this did much) I reinstalled firedrake and found the following:
-> on ubuntu firedrake, petsc4py, mpi4py are all located in "firedrake/local/lib/python2.7/site-packages".
On my mac the local folder does not exist.
-> I see that these are all located in the following, which is not in my path.
firedrake/lib/python2.7/site-packages/petsc4py
I think you mean here that all the python packages are installed under firedrake/lib/python2.7/site-packages This is correct. It's just a minor difference in where virtualenv installs packages on Ubuntu and on Mac. Activating the virtualenv will put the appropriate site-packages in your path. Are you sure that the directory is not in sys.path after activating the virtualenv with: source firedrake/bin/activate ?
When I open python and append to my path
sys.path.append("/Users/fpoulin/software/firedrake/lib/python2.7/site-packages")
then I can import petsc4py, mpi4py, but firedrake cannot be imported because of h5py. I am going to redo this now including all the options in PETSC and wonder if that will fix this problem.
just adding sys.path is very unlikely to work. You really need to activate the virtualenv in order to properly access all the things which the install script installs.
import firedrake Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/firedrake/__init__.py", line 33, in <module> from firedrake.checkpointing import * File "/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/firedrake/checkpointing.py", line 4, in <module> from firedrake import hdf5interface as h5i File "firedrake/hdf5interface.pyx", line 1, in init firedrake.hdf5interface (firedrake/hdf5interface.c:2016) ImportError: No module named h5py
But it seems to me that maybe there is a problem with the paths set up on my mac, and maybe other macs as well?
I think it's just activating the virtualenv. Firedrake currently runs fine on our Macs and on the Macs at travis-ci (the online build test service we use). Regards, David
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
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. Francis-Poulins-MacBook-Pro:software fpoulin$ source firedrake/bin/activate (firedrake)Francis-Poulins-MacBook-Pro:software fpoulin$ python Python 2.7.11 (default, Jan 22 2016, 08:28:37) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import sys
sys.path
['', '/usr/local/lib/python2.7/site-packages/cbcdns-1.0.0-py2.7.egg', '/Users/fpoulin/software/pyqg', '/Users/fpoulin/software/pyro2', '/Users/fpoulin/software/SPINSpy', '/Users/fpoulin/software', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/fpoulin/Library/Python/2.7/lib/python/site-packages', '/usr/local/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages/distarray-0.6.0_dev-py2.7.egg', '/Library/Python/2.7/site-packages/numpy-1.9.2-py2.7-macosx-10.9-intel.egg', '/Library/Python/2.7/site-packages']
import petsc4py
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named petsc4py 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")
import petsc4py
import firedrake
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/firedrake/__init__.py", line 33, in <module> from firedrake.checkpointing import * File "/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/firedrake/checkpointing.py", line 4, in <module> from firedrake import hdf5interface as h5i File "firedrake/hdf5interface.pyx", line 1, in init firedrake.hdf5interface (firedrake/hdf5interface.c:2016) ImportError: No module named h5py 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/ I agree that there is something odd here in my installation in regards to the path. Any advice would be greatly appreciated. Francis
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
Thanks Lawrence. Below are my results. ** regular ** Francis-Poulins-MacBook-Pro:~ fpoulin$ which python Francis-Poulins-MacBook-Pro:~ fpoulin$ python -c "import sys; print sys.executable; print sys.path" /usr/local/opt/python/bin/python2.7 ['', '/usr/local/lib/python2.7/site-packages/cbcdns-1.0.0-py2.7.egg', '/Users/fpoulin/software/pyqg', '/Users/fpoulin/software/pyro2', '/Users/fpoulin/software/SPINSpy', '/Users/fpoulin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/fpoulin/Library/Python/2.7/lib/python/site-packages', '/usr/local/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages/distarray-0.6.0_dev-py2.7.egg', '/Library/Python/2.7/site-packages/numpy-1.9.2-py2.7-macosx-10.9-intel.egg', '/Library/Python/2.7/site-packages'] ** virtualenv ** Francis-Poulins-MacBook-Pro:~ fpoulin$ cd ~/software/ Francis-Poulins-MacBook-Pro:software fpoulin$ source firedrake/bin/activate (firedrake)Francis-Poulins-MacBook-Pro:software fpoulin$ which python /Users/fpoulin/software/firedrake/bin/python (firedrake)Francis-Poulins-MacBook-Pro:software fpoulin$ python -c "import sys; print sys.executable; print sys.path" /usr/local/opt/python/bin/python2.7 ['', '/usr/local/lib/python2.7/site-packages/cbcdns-1.0.0-py2.7.egg', '/Users/fpoulin/software/pyqg', '/Users/fpoulin/software/pyro2', '/Users/fpoulin/software/SPINSpy', '/Users/fpoulin/software', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/fpoulin/Library/Python/2.7/lib/python/site-packages', '/usr/local/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages/distarray-0.6.0_dev-py2.7.egg', '/Library/Python/2.7/site-packages/numpy-1.9.2-py2.7-macosx-10.9-intel.egg', '/Library/Python/2.7/site-packages'] Sadly, there is no firedrake in my path at all. I guess that explains why it can't find anything but it's strange that it wasn't added. Thanks, Francis ------------------ Francis Poulin Associate Professor Department of Applied Mathematics University of Waterloo email: fpoulin@uwaterloo.ca Web: https://uwaterloo.ca/poulin-research-group/ Telephone: +1 519 888 4567 x32637 ________________________________________ From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Lawrence Mitchell [lawrence.mitchell@imperial.ac.uk] Sent: Friday, February 05, 2016 7:39 AM To: firedrake@imperial.ac.uk Subject: Re: [firedrake] upgrading firedrake (problem found!)
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
On 5 Feb 2016, at 13:27, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
Thanks Lawrence. Below are my results.
** regular ** Francis-Poulins-MacBook-Pro:~ fpoulin$ which python Francis-Poulins-MacBook-Pro:~ fpoulin$ python -c "import sys; print sys.executable; print sys.path" /usr/local/opt/python/bin/python2.7
...
** virtualenv **
Francis-Poulins-MacBook-Pro:~ fpoulin$ cd ~/software/ Francis-Poulins-MacBook-Pro:software fpoulin$ source firedrake/bin/activate (firedrake)Francis-Poulins-MacBook-Pro:software fpoulin$ which python /Users/fpoulin/software/firedrake/bin/python (firedrake)Francis-Poulins-MacBook-Pro:software fpoulin$ python -c "import sys; print sys.executable; print sys.path" /usr/local/opt/python/bin/python2.7
... This is the bit that's wrong, I think. Although your shell thinks that python is the python executable in the virtualenv, when you launch python, it's the same as if you had not activated the virtualenv. If you run /Users/fpoulin/software/firedrake/bin/python -c "import sys; print sys.executable; print sys.path" What do you get? Additionally, before and after virtualenv activation, what does. $ python -c "import sys; print sys.version" say? And also, before and after virtualenv activation, what is: $ env Thanks, Lawrence
Thanks Lawrence. Here goes... ** Test 1 ** FrancisulinsMBP:software fpoulin$ /Users/fpoulin/software/firedrake/bin/python -c "import sys; print sys.executable; print sys.path" /Users/fpoulin/software/firedrake/bin/python ['', '/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/h5py-2.5.0-py2.7-macosx-10.10-x86_64.egg', '/Users/fpoulin/software/pyro2', '/Users/fpoulin/software/SPINSpy', '/Users/fpoulin/software', '/Users/fpoulin/software/firedrake/lib/python27.zip', '/Users/fpoulin/software/firedrake/lib/python2.7', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-darwin', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-mac', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-tk', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-old', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-dynload', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/fpoulin/software/firedrake/lib/python2.7/site-packages'] FrancisulinsMBP:software fpoulin$ clear FrancisulinsMBP:software fpoulin$ /Users/fpoulin/software/firedrake/bin/python -c "import sys; print sys.executable; print sys.path" /Users/fpoulin/software/firedrake/bin/python ['', '/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/h5py-2.5.0-py2.7-macosx-10.10-x86_64.egg', '/Users/fpoulin/software/pyro2', '/Users/fpoulin/software/SPINSpy', '/Users/fpoulin/software', '/Users/fpoulin/software/firedrake/lib/python27.zip', '/Users/fpoulin/software/firedrake/lib/python2.7', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-darwin', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-mac', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-tk', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-old', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-dynload', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/fpoulin/software/firedrake/lib/python2.7/site-packages'] ** Test 2 ** FrancisulinsMBP:software fpoulin$ python -c "import sys; print sys.version" 2.7.11 (default, Jan 22 2016, 08:28:37) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] FrancisulinsMBP:software fpoulin$ source firedrake/bin/activate (firedrake)FrancisulinsMBP:software fpoulin$ python -c "import sys; print sys.version" 2.7.11 (default, Jan 22 2016, 08:28:37) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] ** Test 3 ** FrancisulinsMBP:software fpoulin$ env TERM_PROGRAM=Apple_Terminal MATLABPATH=/Users/fpoulin/Research/claw/matlab SHELL=/bin/bash TERM=xterm-256color TMPDIR=/var/folders/nl/wfwj3nps2wx8m6jx9bh_gslc0000gn/T/ Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.JC9FzxGCzb/Render TERM_PROGRAM_VERSION=343.7 cxx=/usr/local/bin/c++-4.9 OLDPWD=/Users/fpoulin TERM_SESSION_ID=472C6396-7536-49E1-BFF5-D36BDAA77C76 PYRO_HOME=/Users/fpoulin/software/pyro2 gcc=/usr/local/bin/gcc-4.9 USER=fpoulin SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.3FmaQgwRmL/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 mpirun=/usr/local/bin/mpirun PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/X11R6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin gxx=/usr/local/bin/g++-4.9 PWD=/Users/fpoulin/software NCARG_ROOT=/usr/local LANG=en_CA.UTF-8 XPC_FLAGS=0x0 XPC_SERVICE_NAME=0 SHLVL=1 HOME=/Users/fpoulin mpifort=/usr/local/bin/mpifort mpig90=/usr/local/bin/mpif90 PYTHONPATH=/Users/fpoulin/software/pyro2:/Users/fpoulin/software/SPINSpy:: LOGNAME=fpoulin DISPLAY=/private/tmp/com.apple.launchd.sp7NtBmLwn/org.macosforge.xquartz:0 cpp=/usr/local/bin/cpp-4.9 mpig77=/usr/local/bin/mpif77 mpicxx=/usr/local/bin/mpic++ _=/usr/bin/env FrancisulinsMBP:software fpoulin$ source firedrake/bin/activate (firedrake)FrancisulinsMBP:software fpoulin$ env TERM_PROGRAM=Apple_Terminal MATLABPATH=/Users/fpoulin/Research/claw/matlab SHELL=/bin/bash TERM=xterm-256color TMPDIR=/var/folders/nl/wfwj3nps2wx8m6jx9bh_gslc0000gn/T/ Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.JC9FzxGCzb/Render TERM_PROGRAM_VERSION=343.7 cxx=/usr/local/bin/c++-4.9 OLDPWD=/Users/fpoulin TERM_SESSION_ID=472C6396-7536-49E1-BFF5-D36BDAA77C76 PYRO_HOME=/Users/fpoulin/software/pyro2 gcc=/usr/local/bin/gcc-4.9 USER=fpoulin SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.3FmaQgwRmL/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 VIRTUAL_ENV=/Users/fpoulin/software/firedrake mpirun=/usr/local/bin/mpirun PATH=/Users/fpoulin/software/firedrake/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/X11R6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin gxx=/usr/local/bin/g++-4.9 PWD=/Users/fpoulin/software NCARG_ROOT=/usr/local LANG=en_CA.UTF-8 XPC_FLAGS=0x0 PS1=(firedrake)\h:\W \u\$ XPC_SERVICE_NAME=0 SHLVL=1 HOME=/Users/fpoulin mpifort=/usr/local/bin/mpifort mpig90=/usr/local/bin/mpif90 PYTHONPATH=/Users/fpoulin/software/pyro2:/Users/fpoulin/software/SPINSpy:: LOGNAME=fpoulin DISPLAY=/private/tmp/com.apple.launchd.sp7NtBmLwn/org.macosforge.xquartz:0 cpp=/usr/local/bin/cpp-4.9 mpig77=/usr/local/bin/mpif77 mpicxx=/usr/local/bin/mpic++ _=/usr/bin/env (firedrake)FrancisulinsMBP:software fpoulin$ ** Test 4 ** Below you'll see that when I type the path of python, as you suggested, an example works. Even though this is what I think is aliased, it seems to be using the wrong version. (firedrake)FrancisulinsMBP:software fpoulin$ /Users/fpoulin/software/firedrake/bin/python firedrake/src/firedrake/tests/test_0init.py ============================================================= test session starts ============================================================== platform darwin -- Python 2.7.11, pytest-2.8.7, py-1.4.31, pluggy-0.3.1 rootdir: /Users/fpoulin/software/firedrake/src/firedrake, inifile: collected 2 items firedrake/src/firedrake/tests/test_0init.py .. =========================================================== 2 passed in 0.03 seconds =========================================================== (firedrake)FrancisulinsMBP:software fpoulin$ python firedrake/src/firedrake/tests/test_0init.py Traceback (most recent call last): File "firedrake/src/firedrake/tests/test_0init.py", line 3, in <module> from firedrake import * ImportError: No module named firedrake
OK, I hope we're getting to the root of the problem.
On 5 Feb 2016, at 15:02, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
Thanks Lawrence. Here goes...
** Test 1 **
FrancisulinsMBP:software fpoulin$ /Users/fpoulin/software/firedrake/bin/python -c "import sys; print sys.executable; print sys.path" /Users/fpoulin/software/firedrake/bin/python ['', '/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/h5py-2.5.0-py2.7-macosx-10.10-x86_64.egg', '/Users/fpoulin/software/pyro2', '/Users/fpoulin/software/SPINSpy', '/Users/fpoulin/software', '/Users/fpoulin/software/firedrake/lib/python27.zip', '/Users/fpoulin/software/firedrake/lib/python2.7', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-darwin', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-mac', '/Users/fpoulin/software/firedrake/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-tk', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-old', '/Users/fpoulin/software/firedrake/lib/python2.7/lib-dynload', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/fpoulin/software/firedrake/lib/python2.7/site-packages']
This looks good, the virtualenv is working, we just need to figure out how to pick up the correct python when not providing the full path.
** Test 2 **
FrancisulinsMBP:software fpoulin$ python -c "import sys; print sys.version" 2.7.11 (default, Jan 22 2016, 08:28:37) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
FrancisulinsMBP:software fpoulin$ source firedrake/bin/activate (firedrake)FrancisulinsMBP:software fpoulin$ python -c "import sys; print sys.version" 2.7.11 (default, Jan 22 2016, 08:28:37) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
Also good.
** Test 3 **
FrancisulinsMBP:software fpoulin$ env TERM_PROGRAM=Apple_Terminal MATLABPATH=/Users/fpoulin/Research/claw/matlab SHELL=/bin/bash TERM=xterm-256color TMPDIR=/var/folders/nl/wfwj3nps2wx8m6jx9bh_gslc0000gn/T/ Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.JC9FzxGCzb/Render TERM_PROGRAM_VERSION=343.7 cxx=/usr/local/bin/c++-4.9 OLDPWD=/Users/fpoulin TERM_SESSION_ID=472C6396-7536-49E1-BFF5-D36BDAA77C76 PYRO_HOME=/Users/fpoulin/software/pyro2 gcc=/usr/local/bin/gcc-4.9 USER=fpoulin SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.3FmaQgwRmL/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 mpirun=/usr/local/bin/mpirun PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/X11R6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin gxx=/usr/local/bin/g++-4.9 PWD=/Users/fpoulin/software NCARG_ROOT=/usr/local LANG=en_CA.UTF-8 XPC_FLAGS=0x0 XPC_SERVICE_NAME=0 SHLVL=1 HOME=/Users/fpoulin mpifort=/usr/local/bin/mpifort mpig90=/usr/local/bin/mpif90 PYTHONPATH=/Users/fpoulin/software/pyro2:/Users/fpoulin/software/SPINSpy:: LOGNAME=fpoulin DISPLAY=/private/tmp/com.apple.launchd.sp7NtBmLwn/org.macosforge.xquartz:0 cpp=/usr/local/bin/cpp-4.9 mpig77=/usr/local/bin/mpif77 mpicxx=/usr/local/bin/mpic++ _=/usr/bin/env
FrancisulinsMBP:software fpoulin$ source firedrake/bin/activate (firedrake)FrancisulinsMBP:software fpoulin$ env TERM_PROGRAM=Apple_Terminal MATLABPATH=/Users/fpoulin/Research/claw/matlab SHELL=/bin/bash TERM=xterm-256color TMPDIR=/var/folders/nl/wfwj3nps2wx8m6jx9bh_gslc0000gn/T/ Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.JC9FzxGCzb/Render TERM_PROGRAM_VERSION=343.7 cxx=/usr/local/bin/c++-4.9 OLDPWD=/Users/fpoulin TERM_SESSION_ID=472C6396-7536-49E1-BFF5-D36BDAA77C76 PYRO_HOME=/Users/fpoulin/software/pyro2 gcc=/usr/local/bin/gcc-4.9 USER=fpoulin SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.3FmaQgwRmL/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 VIRTUAL_ENV=/Users/fpoulin/software/firedrake mpirun=/usr/local/bin/mpirun PATH=/Users/fpoulin/software/firedrake/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/X11R6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin gxx=/usr/local/bin/g++-4.9 PWD=/Users/fpoulin/software NCARG_ROOT=/usr/local LANG=en_CA.UTF-8 XPC_FLAGS=0x0 PS1=(firedrake)\h:\W \u\$ XPC_SERVICE_NAME=0 SHLVL=1 HOME=/Users/fpoulin mpifort=/usr/local/bin/mpifort mpig90=/usr/local/bin/mpif90 PYTHONPATH=/Users/fpoulin/software/pyro2:/Users/fpoulin/software/SPINSpy:: LOGNAME=fpoulin DISPLAY=/private/tmp/com.apple.launchd.sp7NtBmLwn/org.macosforge.xquartz:0 cpp=/usr/local/bin/cpp-4.9 mpig77=/usr/local/bin/mpif77 mpicxx=/usr/local/bin/mpic++ _=/usr/bin/env (firedrake)FrancisulinsMBP:software fpoulin$
Nothing looks out of the ordinary here, either.
** Test 4 **
Below you'll see that when I type the path of python, as you suggested, an example works. Even though this is what I think is aliased, it seems to be using the wrong version.
(firedrake)FrancisulinsMBP:software fpoulin$ /Users/fpoulin/software/firedrake/bin/python firedrake/src/firedrake/tests/test_0init.py ============================================================= test session starts ============================================================== platform darwin -- Python 2.7.11, pytest-2.8.7, py-1.4.31, pluggy-0.3.1 rootdir: /Users/fpoulin/software/firedrake/src/firedrake, inifile: collected 2 items
firedrake/src/firedrake/tests/test_0init.py ..
Great, so firedrake is installed and can be imported and run if you provide the full path. So, what does, again before and after virtualenv activation, the following say: $ type python Thanks, Lawrence
Yes, I agree that firedrake is installed and can work, but it seems to be using my homebrew version of python, not the firedrake version. To answer the two questions: ** Question 1 ** regular am-laptop24:software fpoulin$ alias | grep python alias ipython='/usr/local/bin/ipython' alias python='/usr/local/bin/python' virtualenv (firedrake)am-laptop24:software fpoulin$ alias | grep python alias ipython='/usr/local/bin/ipython' alias pydoc='python -m pydoc' alias python='/usr/local/bin/python' alias pythonana='/Applications/anaconda/bin/python' ** Question 2 ** regular am-laptop24:software fpoulin$ type python python is aliased to `/usr/local/bin/python' virtualenv (firedrake)am-laptop24:software fpoulin$ type python python is aliased to `/usr/local/bin/python' ** Testing 3 different pythons **
On 5 Feb 2016, at 16:00, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
Yes, I agree that firedrake is installed and can work, but it seems to be using my homebrew version of python, not the firedrake version. To answer the two questions:
** Question 1 **
regular
am-laptop24:software fpoulin$ alias | grep python alias ipython='/usr/local/bin/ipython' alias python='/usr/local/bin/python'
virtualenv
(firedrake)am-laptop24:software fpoulin$ alias | grep python alias ipython='/usr/local/bin/ipython' alias pydoc='python -m pydoc' alias python='/usr/local/bin/python' alias pythonana='/Applications/anaconda/bin/python'
** Question 2 **
regular
am-laptop24:software fpoulin$ type python python is aliased to `/usr/local/bin/python'
virtualenv
(firedrake)am-laptop24:software fpoulin$ type python python is aliased to `/usr/local/bin/python'
OK, great, this is the problem. These alias settings (presumably in your basic or similar) override whatever is in PATH. if you "unalias python" and similarly "unalias ipython" then after activating the virtualenv you should get the correct interpreter. Hopefully with this done you should be good to go! ...
** env stuff **
It seems that to install firedrake my computer us using clang, default C compiler, even though I wanted it to use homebrew. For consistency. On a very minor note, how can one change this?
Homebrew defaults to building all C programs with clang, which we just pick up. See https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Custom-G... for their rationale. In particular, the C++ ABI in the gcc-5 series is no longer compatible with that of clang (at least as of quite recently). As a result, any C++ library that home-brew (or apple provides) which will have been built with clang, must be rebuilt for gcc-5. Cheers, Lawrence
(firedrake)am-laptop24:software fpoulin$ /Users/fpoulin/software/firedrake/bin/ipython firedrake/src/firedrake/tests/test_0init.py --------------------------------------------------------------------------- Great news! I aliased python and ipython in path, started virtual env and the test for python works. The not so great news is that ipython still has problems, see below. I think this used to work before I upgraded ipython. This isn't the same problem as before as I am specifying the whole path, but the same thing happens of course even if I simply type ipython. ValueError Traceback (most recent call last) /Users/fpoulin/software/firedrake/src/firedrake/tests/test_0init.py in <module>() 20 if __name__ == '__main__': 21 import os ---> 22 pytest.main(os.path.abspath(__file__)) /Users/fpoulin/software/firedrake/lib/python2.7/site-packages/_pytest/config.pyc in main(args, plugins) 36 try: 37 try: ---> 38 config = _prepareconfig(args, plugins) 39 except ConftestImportFailure as e: 40 tw = py.io.TerminalWriter(sys.stderr) /Users/fpoulin/software/firedrake/lib/python2.7/site-packages/_pytest/config.pyc in _prepareconfig(args, plugins) 103 elif not isinstance(args, (tuple, list)): 104 if not isinstance(args, str): --> 105 raise ValueError("not a string or argument list: %r" % (args,)) 106 args = shlex.split(args) 107 config = get_config() ValueError: not a string or argument list: u'/Users/fpoulin/software/firedrake/src/firedrake/tests/test_0init.py'
On 5 Feb 2016, at 16:39, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
(firedrake)am-laptop24:software fpoulin$ /Users/fpoulin/software/firedrake/bin/ipython firedrake/src/firedrake/tests/test_0init.py --------------------------------------------------------------------------- Great news! I aliased python and ipython in path, started virtual env and the test for python works.
OK, good. I would recommend not using aliases in your shell (it's easy to forget about them and they don't carry around well).
The not so great news is that ipython still has problems, see below. I think this used to work before I upgraded python.
See below, I think this is not actually an issue with the installation.
This isn't the same problem as before as I am specifying the whole path, but the same thing happens of course even if I simply type ipython.
ValueError Traceback (most recent call last) /Users/fpoulin/software/firedrake/src/firedrake/tests/test_0init.py in <module>() 20 if __name__ == '__main__': 21 import os ---> 22 pytest.main(os.path.abspath(__file__))
/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/_pytest/config.pyc in main(args, plugins) 36 try: 37 try: ---> 38 config = _prepareconfig(args, plugins) 39 except ConftestImportFailure as e: 40 tw = py.io.TerminalWriter(sys.stderr)
/Users/fpoulin/software/firedrake/lib/python2.7/site-packages/_pytest/config.pyc in _prepareconfig(args, plugins) 103 elif not isinstance(args, (tuple, list)): 104 if not isinstance(args, str): --> 105 raise ValueError("not a string or argument list: %r" % (args,)) 106 args = shlex.split(args) 107 config = get_config()
ValueError: not a string or argument list: u'/Users/fpoulin/software/firedrake/src/firedrake/tests/test_0init.py'
I too have this problem, I do not think it is an issue for actually using firedrake. The problem has occurred because, for whatever reason, the file path that pytest gets is of type "unicode" which is not an instance of "str". I recommend running the tests with the py.test binary: e.g. if you want to run a single test file: py.test path/to/test_file.py The ability to run the tests individually just using python is a "convenience" in case you can't retrain yourself to type py.test. Thanks, Lawrence
Ok, good to know. Thanks everyone for all of the help, and sorry that this took so many emails. I will try to avoid aliases where possible, and encourage my students to do the same. Now to actually start running some demos!
participants (4)
- 
                
                David Ham
- 
                
                Francis Poulin
- 
                
                Homolya, Miklós
- 
                
                Lawrence Mitchell