# UM python3/2.7 create\_ancil\_links.py

**URL:** <https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609>\
**Category:** Unified Model\
**Tags:** ARCHER2\
**Created:** [8 June 2022 12:35 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609 "2022-06-08T12:35:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanHodson](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/danhodson/32/121_2.png) [@DanHodson](https://cms-helpdesk.ncas.ac.uk/u/DanHodson)\
**Post date:** [8 June 2022 12:35 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/1 "2022-06-08T12:35:02Z")

</div>

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.htm](https://ncas-cms.github.io/um-training/getting-setup.html)l 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

---

<div class="post-metadata">

**Author:** ![RosalynHatcher](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/rosalynhatcher/32/11_2.png) [@RosalynHatcher](https://cms-helpdesk.ncas.ac.uk/u/RosalynHatcher)\
**Post date:** [8 June 2022 12:55 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/2 "2022-06-08T12:55:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanHodson](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/danhodson/32/121_2.png) [@DanHodson](https://cms-helpdesk.ncas.ac.uk/u/DanHodson)\
**Post date:** [8 June 2022 14:18 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/3 "2022-06-08T14:18:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RosalynHatcher](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/rosalynhatcher/32/11_2.png) [@RosalynHatcher](https://cms-helpdesk.ncas.ac.uk/u/RosalynHatcher)\
**Post date:** [8 June 2022 14:47 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/4 "2022-06-08T14:47:10Z")

</div>

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?

```auto
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.

---

<div class="post-metadata">

**Author:** ![DanHodson](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/danhodson/32/121_2.png) [@DanHodson](https://cms-helpdesk.ncas.ac.uk/u/DanHodson)\
**Post date:** [8 June 2022 16:05 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/5 "2022-06-08T16:05:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RosalynHatcher](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/rosalynhatcher/32/11_2.png) [@RosalynHatcher](https://cms-helpdesk.ncas.ac.uk/u/RosalynHatcher)\
**Post date:** [8 June 2022 17:23 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/6 "2022-06-08T17:23:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanHodson](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/danhodson/32/121_2.png) [@DanHodson](https://cms-helpdesk.ncas.ac.uk/u/DanHodson)\
**Post date:** [8 June 2022 22:13 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/7 "2022-06-08T22:13:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RosalynHatcher](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/rosalynhatcher/32/11_2.png) [@RosalynHatcher](https://cms-helpdesk.ncas.ac.uk/u/RosalynHatcher)\
**Post date:** [9 June 2022 05:47 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/8 "2022-06-09T05:47:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanHodson](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/danhodson/32/121_2.png) [@DanHodson](https://cms-helpdesk.ncas.ac.uk/u/DanHodson)\
**Post date:** [9 June 2022 11:30 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/9 "2022-06-09T11:30:09Z")

</div>

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

Cheers,

Dan

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/cms_support/original/1X/1fd2411499ffcbc299fe756cd5cdf26e44956558.png) [@system](https://cms-helpdesk.ncas.ac.uk/u/system)\
**Post date:** [1 November 2023 21:02 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/10 "2023-11-01T21:02:30Z")

</div>



---

<div class="post-metadata">

**Author:** ![RosalynHatcher](https://dub1.discourse-cdn.com/flex013/user_avatar/cms-helpdesk.ncas.ac.uk/rosalynhatcher/32/11_2.png) [@RosalynHatcher](https://cms-helpdesk.ncas.ac.uk/u/RosalynHatcher)\
**Post date:** [2 November 2023 22:20 UTC](https://cms-helpdesk.ncas.ac.uk/t/um-python3-2-7-create-ancil-links-py/609/11 "2023-11-02T22:20:02Z")

</div>


