Opened 4 months ago

Closed 3 months ago

#2943 closed error (fixed)

Error with Python?

Reported by: ha392 Owned by: um_support
Component: UM Model Keywords: Python
Cc: Platform: ARCHER
UM Version: 10.7

Description

Hello,

Hopefully this will be an easy question. I have a process calling python in my model but I seem to be getting an odd error with 'import mule'-

http://puma.nerc.ac.uk/rose-bush/view/ha392/u-bj524?&no_fuzzy_time=0&path=log/job/20000401T0000Z/gen_initial_dumps/01/job.err

Traceback (most recent call last):
  File "/work/n02/n02/ha392/cylc-run/u-bj524/app/gen_initial_dumps/bin/gen_dumps", line 4, in <module>
    import mule
  File "/work/y07/y07/umshared/lib/python2.7/mule/__init__.py", line 56, in <module>
    import six
ImportError: No module named six

Am I calling this wrong in my 'gen_initial_dumps' file? Or do I need to set something up on my ARCHER?

Thank you,
Holly

Change History (3)

comment:1 Changed 4 months ago by ros

Hi Holly,

To run python on ARCHER you need to load the anaconda python environment.

In suite.rc in the [[gen_initial_dumps]] add after the inherit line:

pre-script = "module load anaconda"

I would also recommend changing the #!/usr/bin/python2 line at the top of the gen_dumps script to #!/usr/bin/env python so it picks up the correct python in the environment.

Hopefully that will fix things.

Regards,
Ros.

comment:2 Changed 4 months ago by ha392

Brilliant! Thank you, Ros!

comment:3 Changed 3 months ago by ros

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.