0

I installed a module one month ago. At that time, I could import the module successfully.

Now, when I import this module, there is an ImportError,

>>> import anuga
Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/home/lili/anuga_core/source/anuga/__init__.py", line 110, in <module> from anuga.file_conversion.urs2nc import urs2nc
    File "/home/lili/anuga_core/source/anuga/file_conversion/urs2nc.py", line 12, in <module>
        from mux import WAVEHEIGHT_MUX_LABEL, EAST_VELOCITY_LABEL, \
    ImportError: No module named mux

How could I solve this problem?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • What OS are you running this code on? – Talvalin Jan 28 '13 at 11:43
  • Look for a file named mux.py. In what directory is it located? – unutbu Jan 28 '13 at 11:43
  • 1
    did you updated python to a more recent version in the meantime? – furins Jan 28 '13 at 11:49
  • 1
    Have you gone through the Anuga installation guide (http://anuga.anu.edu.au/raw-attachment/wiki/WikiStart/anuga_installation_guide-1.2.1.pdf)? If you're using Windows there's a step that involves adding values to the PATH environment variable in the appendix. – Talvalin Jan 28 '13 at 11:53
  • I use Ubuntu,I didn't find mux.py file.And I also finished to update the anuga model. DO you think it is the problem of Python? Now I am wondering if it is the problem of Python rather than Anuga.@Talvalin@furins@unutbu – facebook-100003196165797 Jan 28 '13 at 14:36
  • Should this be tagged with ANUGA? Reference for [ANUGA](https://pypi.org/project/anuga/#id2). – Peter Mortensen Jun 07 '22 at 11:56

1 Answers1

1

ImportError comes only when the module is not available in the list called sys.path. Since the current operating system is Linux based (I got an idea from the error message /home/lili), it is required to have mux.py in the path (i.e, sys.path). The mux.py file will be exactly similar to the file available in this link.

`https://anuga.anu.edu.au/svn/anuga/trunk/anuga_core/source/anuga/file/mux.py`

All these problems come when the installation of ANUGA is not proper.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
kvivek
  • 3,321
  • 1
  • 15
  • 17