knaughten / mitgcm_python

Python scripts designed for my Weddell Sea and Amundsen Sea configurations of MITgcm.
25 stars 17 forks source link

Errors on trying to import MITgcmutils #3

Closed DaniJonesOcean closed 3 years ago

DaniJonesOcean commented 3 years ago

Hi Kaitlin,

I am trying to use mitgcm_python on BAS HPC. I have my $PYTHONPATH environment variable set as follows:

>echo $PYTHONPATH
/users/[username]/MITgcm/utils/python/MITgcmutils

However, when I try to import MITgcmutils, I get the following errors:

>>> import MITgcmutils

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/users/(username)/.local/lib/python2.7/site-packages/MITgcmutils-0.1.0-py2.7.egg/MITgcmutils/__init__.py", line 6, in <module>
    import cs
  File "/users/(username)/.local/lib/python2.7/site-packages/MITgcmutils-0.1.0-py2.7.egg/MITgcmutils/cs/__init__.py", line 1, in <module>
    from .pcol import pcol
  File "/users/(username)/.local/lib/python2.7/site-packages/MITgcmutils-0.1.0-py2.7.egg/MITgcmutils/cs/pcol.py", line 2, in <module>
    import matplotlib.pyplot as plt
  File "/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/pyplot.py", line 30, in <module>
    from matplotlib import style
  File "/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/style/__init__.py", line 3, in <module>
    from .core import use, context, available, library, reload_library
  File "/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/style/core.py", line 220, in <module>
    _base_library = load_base_library()
  File "/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/style/core.py", line 158, in load_base_library
    library.update(read_style_directory(BASE_LIBRARY_PATH))
  File "/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/style/core.py", line 190, in read_style_directory
    for path, name in iter_style_files(style_dir):
  File "/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/style/core.py", line 179, in iter_style_files
    for path in os.listdir(style_dir):
OSError: [Errno 13] Permission denied: '/packages/python/miniconda3/envs/python-2.7.14/lib/python2.7/site-packages/matplotlib/mpl-data/stylelib'

Is there something wrong with my Python installation? I'm using 2.7.14 for compatibility.

knaughten commented 3 years ago

Hi Dan, I think the problem is that you need to set up a miniconda2 environment to align with python2.7? I would contact the BAS IT helpdesk if you can't figure it out - setting up the proper python installation with all the sub-packages can be tricky.

DaniJonesOcean commented 3 years ago

There was a permissions issue on BAS HPC. BAS IT have quickly and helpfully fixed it! Closing now.