Skip to content

PyOP2 quick install instructions do not sort out imports #45

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

Closed
dorugeber opened this issue Oct 22, 2013 · 9 comments
Closed

PyOP2 quick install instructions do not sort out imports #45

dorugeber opened this issue Oct 22, 2013 · 9 comments

Comments

@dorugeber
Copy link
Contributor

Leads to errors like

ImportError: No module named pyop2, yaml, ...

One solution would be to copy FEniCS's Dorsal by writing out a

add the following line to your .bashrc: source /blah/blah.conf

or

export PYTHONPATH=...
@kynan
Copy link
Member

kynan commented Oct 23, 2013

The YAML dependency was indeed missing. That's fixed by OP2/PyOP2#258

You shouldn't need to add PyOP2 to your PYTHONPATH, the python setup.py develop should take care of that.

@kynan
Copy link
Member

kynan commented Oct 23, 2013

Can anyone verify this? @funsim? @ctjacobs?

@ctjacobs
Copy link
Contributor

I've just re-run the PyOP2 install.sh script on a fresh install of Ubuntu 12.04 (with sudo bash). The installation of all dependencies and the PyOP2 testing were successful. However, the same reported ImportErrors appeared when running the Firedrake tests:

  • ImportError: No module named pyop2. Worked around using sudo python setup.py install from within the PyOP2 directory.
  • ImportError: No module named yaml. Worked around using sudo apt-get install python-yaml, although the PyYAML package was already present in the .local directory:

christian@christian-VirtualBox:~/firedrake$ sudo -E pip install PyYAML Requirement already satisfied (use --upgrade to upgrade): PyYAML in /home/christian/.local/lib/python2.7/site-packages/PyYAML-3.10-py2.7-linux-i686.egg Cleaning up...

  • ImportError: No module named cgen. Worked around using sudo -E pip install cgen.

@kynan
Copy link
Member

kynan commented Oct 23, 2013

@ctjacobs Any chance you could try again with fa12823? I think I should have fixed these issues (apart from cgen, which is not a PyOP2 dependency for the sequential backend).

@ctjacobs
Copy link
Contributor

Thanks Florian. The pyop2 and yaml ImportErrors have now gone, but when I try "from firedrake import *" in IPython I still get the following message about cgen:

In [1]: from firedrake import *
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/home/christian/firedrake/<ipython-input-1-379626444471> in <module>()
----> 1 from firedrake import *

/home/christian/firedrake/python/firedrake/__init__.py in <module>()
----> 1 from core_types import *
      2 from projection import *
      3 from ufl import *
      4 from ufl_expr import *
      5 from pyop2.logger import *

/home/christian/firedrake/core_types.pyx in init firedrake.core_types (firedrake/core_types.c:37460)()

/home/christian/firedrake/python/firedrake/assemble_expressions.py in <module>()
      4 from pyop2 import op2
      5 import core_types
----> 6 import cgen
      7
      8

ImportError: No module named cgen

@dham
Copy link
Member

dham commented Oct 27, 2013

That's a problem in the Firedrake install instructions which I have just fixed. The changes are at:

http://www.firedrakeproject.org/download.html#firedrake

but for reference:

sudo pip install cgen

@ctjacobs
Copy link
Contributor

Thanks David. I no longer get ImportErrors when importing firedrake.

@dham
Copy link
Member

dham commented Oct 28, 2013

Can we close this issue now?

@kynan
Copy link
Member

kynan commented Oct 28, 2013

I think we can. Reopen if you find more issues.

@kynan kynan closed this as completed Oct 28, 2013
wence- added a commit that referenced this issue May 15, 2015
wence- added a commit that referenced this issue May 15, 2015
wence- added a commit that referenced this issue May 15, 2015
connorjward pushed a commit that referenced this issue Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants