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

thetis error #372

Open
charithaRdissanayaka opened this issue Jul 26, 2024 · 13 comments
Open

thetis error #372

charithaRdissanayaka opened this issue Jul 26, 2024 · 13 comments

Comments

@charithaRdissanayaka
Copy link

Dear all,

I am very new for thetis.
i installed firedrake and clone the thetis folder from github.
how can I run the example cases?
I just run examples/channel3d/channel3d.py, then following error encountered.

(firedrake) yachiyo@DRS101092606:/mnt/c/Users/Z02263/Desktop/THETIS/thetis/examples/channel3d$ python3 channel3d.py
Traceback (most recent call last):
File "/mnt/c/Users/Z02263/Desktop/THETIS/thetis/examples/channel3d/channel3d.py", line 13, in
from thetis import *
ModuleNotFoundError: No module named 'thetis'

Please be kind enough to explain me how to start thetis modelling work.

@cpjordan
Copy link
Contributor

Hello! Looks like you have activated the Firedrake virtual environment but Thetis is not found when you try to run an example - did you install Thetis when you installed Firedrake i.e. python3 firedrake-install --install thetis?

If not, you should be able to install Thetis as explained on the website with firedrake-update --install thetis.

@charithaRdissanayaka
Copy link
Author

Hello sir,

yes i installed thetis in to the following directory in wsl by the command python3 firedrake-install --install thetis

Install log saved in /home/charitha/firedrake-install.log

@charithaRdissanayaka
Copy link
Author

how can i run the example please?

@cpjordan
Copy link
Contributor

The example is not running because Thetis is not being imported, which suggests a problem with the install or the path to Thetis. Firstly, you can check that Firedrake has fully installed correctly by running (within your Firedrake environment)?

cd $VIRTUAL_ENV/src/firedrake
pytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection"

@charithaRdissanayaka
Copy link
Author

Hello sir,

I will check this and let you know. I extremely sorry for the late reply. Due to a field visit I unable to do the works related to the thetis on the weekend.

@charithaRdissanayaka
Copy link
Author

Hello sir,

this is the output of the above command.

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 365, in _importconftest
mod = conftestpath.pyimport()
File "/usr/lib/python2.7/dist-packages/py/_path/local.py", line 668, in pyimport
import(modname)
File "/usr/lib/python2.7/dist-packages/pytest/assertion/rewrite.py", line 213, in load_module
py.builtin.exec
(co, mod.dict)
File "/usr/lib/python2.7/dist-packages/py/builtin.py", line 221, in exec
exec2(obj, globals, locals)
File "", line 7, in exec2
File "/home/charitha/firedrake/src/firedrake/tests/conftest.py", line 4, in
from firedrake.petsc import get_external_packages
ImportError: No module named firedrake.petsc
ERROR: could not load /home/charitha/firedrake/src/firedrake/tests/conftest.py

@jwallwork23
Copy link
Contributor

I notice you’re using Python 2. This is unlikely to work as Firedrake (and therefore Thetis) have Python 3 as a dependency. Please could you try reinstalling Firedrake and Thetis using a recent version of Python 3?

@stephankramer
Copy link
Contributor

@charithaRdissanayaka : are you sure you ran that command with the firedrake environment activated? Can you try again but now using:

cd $VIRTUAL_ENV/src/firedrake
python -mpytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection"

(notice the change in the second command)

@charithaRdissanayaka
Copy link
Author

I notice you’re using Python 2. This is unlikely to work as Firedrake (and therefore Thetis) have Python 3 as a dependency. Please could you try reinstalling Firedrake and Thetis using a recent version of Python 3?

Hello Sir,

I installed python3.12 and set the environment.

@charithaRdissanayaka
Copy link
Author

@charithaRdissanayaka : are you sure you ran that command with the firedrake environment activated? Can you try again but now using:

cd $VIRTUAL_ENV/src/firedrake
python -mpytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection"

(notice the change in the second command)

Hello Sir,

I uninstalled the firedrake.
I will reinstall it and check according to your suggestions.
Thank you very much for your kind reply.

@charithaRdissanayaka
Copy link
Author

Hello sir,

I installed poython3.12 and change the environment.
Also re-installed firedrake.
please find the attached log file of the firedrake installation.
I be able to activate the firedrake environment from the following command.
source /home/charitha
firedrake-install.log
/firedrake/bin/activate

(firedrake) charitha@DRS101092606:/firedrake$ cd src/thetis/examples/
(firedrake) charitha@DRS101092606:
/firedrake/src/thetis/examples$ ls
init.py dome sediment_meander_2d
balzano freshwaterCylinder sediment_trench_2d
baroclinic_channel geostrophicGyre stommel2d
baroclinic_eddies idealizedEstuary stommel3d
bottomFriction katophillips tidal_barrage
channel2d lockExchange tidalfarm
channel3d nonhydrostatic_cases tohoku_inversion
channel_inversion north_sea tracerBox
columbia_plume overflow waveEq2d
cylinder_eddies reaction waveEq3d
discrete_turbines rhineROFI

now how can I run the tutorial please?

@cpjordan
Copy link
Contributor

It looks like there are still some problems with the Firedrake install as libsupermesh is not being installed due to some dependencies, to fix this you can follow these steps: firedrakeproject/firedrake#3374

Please try this and then run the tests as Stephan described above to check that Firedrake has installed correctly. Unfortunately it can be a little tricky to install Firedrake, but once it is installed we can run the Thetis examples.

@charithaRdissanayaka
Copy link
Author

Hello sir,

Thank you very much for your reply. I will follow the method explain in the given discussion link.

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