UM python3/2.7 create_ancil_links.py

Hi Ros,

I’m trying to get a copy of u-co057 running as a test of my setup - the reconfiguration currently fails when it tries to run create_ancil_links.py because this is written in python 2.7 and I set up my UM/ROSE environment on ARCHER2 using https://ncas-cms.github.io/um-training/getting-setup.html i.e. . /work/y07/shared/umshared/bin/rose-um-env which sets PYTHONPATH to python3.8
What is the best option here, do you think? Will rose run on ARCHER2 if I change the PYTHONPATH to 2.7, or is there another option here, or something else I am missing?

Thanks!

Cheers,
Dan

Hi Dan,

I’ll take a look after my meeting. This is a copy of u-cn134, CANARI suite which we’re all running ok with the rose-um-env. Rose/Cylc itself runs under python2.7. But tasks like postproc use python3.8.

More shortly.

Cheers,
Ros.

Thanks!
Reinhard said he got it running by changing something in .bashrc or related files to python2.7 - but I wondered whether there is a systematic way of handling a mix of 2.7 and 3.8 scripts? (e.g. in the suite python2.7 create_ancil_links.py ) - or I could edit create_ancil_links.py to use python2.7 explicitly (rather than #!/bin/env python) - but not sure whether that’s the best way to go?

Cheers,

Dan

Hi Dan,

You shouldn’t need to edit the suite or script for it work. Can you please give me read access to your ARCHER2 directories and I’ll take a look at your environment?

chmod -R g+rX /home/n02/n02/lrdlrh
chmod -R g+rX /work/n02/n02/lrdlrh

Can you also please re-run the suite with the original setup so I can see what it’s doing?

Cheers,
Ros.

Hi Ros,

Sorry for the delay!

Ok, chmods done.

The only things I changed from the original I checked out were my username, the run length (to 1 day). I then did a build, which worked. Turned off the build and the model run and turned on the reconfiguration to test that. I’ve resubmitted this reconfiguration run.
Do you want me to rebuild and run the reconfiguration and the model and run everything?

Cheers,
Dan

Hi Dan,

That’s all fine, just remove the change you made to the install_ancil app to add “python2.7” and then do a rose suite-run --new so I can try and see why it’s picking up python3 by default and not python2.7 for that task. I can’t see anything obvious that different in your environment setup.

Cheers,
Ros.

OK, done! (I think)

(Apologies, I am only now making the switch to rose from the umui, so still scrabbling around trying to understand how it all works!)

Cheers,
Dan

Hi Dan,

I’ve found the problem; In your ~/.profile and ~/.bashrc you’ve added /home/n02/n02/dch/cf/bin to your PATH which contains python3.8. It’s this python it picking up rather than the system default python2.7. I don’t know if you need to comment it out of both files or not; I can never remember which one is sourced when!

Reinhard had done a similar thing and was loading cray-python (ARCHER2 python3) in his .profile and had to comment that line out for things to work properly.

Cheers,
Ros.

Great - that worked - Thanks, Ros!
It would have taken me a long time to work that right!

Cheers,

Dan