Skip to content

Issue importing proplot #454

Open
Open
@chfite

Description

@chfite

I have received the following error when trying to import proplot. I have tried switching to prior versions of the "packaging" module (with no luck) since it seems to have an issue with that in cartopy when proplot is imported. Is this a proplot issue, cartopy issue, or some other issue? Any advice on how to fix it?

proplot version is 0.9.7
cartopy version is 0.22.0
packing versions 21.3 up to 24.0 have been tested
matplotlib version 3.4.3
python version is 3.9

In [1]: import proplot
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[1], line 1
----> 1 import proplot

File ~/anaconda3/envs/cf3/lib/python3.9/site-packages/proplot/__init__.py:38
     36     from .colors import *  # noqa: F401 F403
     37 with _benchmark('ticker'):
---> 38     from .ticker import *  # noqa: F401 F403
     39 with _benchmark('scale'):
     40     from .scale import *  # noqa: F401 F403

File ~/anaconda3/envs/cf3/lib/python3.9/site-packages/proplot/ticker.py:18
     16 try:
     17     import cartopy.crs as ccrs
---> 18     from cartopy.mpl.ticker import (
     19         _PlateCarreeFormatter, LatitudeFormatter, LongitudeFormatter
     20     )
     21 except ModuleNotFoundError:
     22     ccrs = None

File ~/anaconda3/envs/cf3/lib/python3.9/site-packages/cartopy/mpl/ticker.py:13
     10 import numpy as np
     12 import cartopy.crs as ccrs
---> 13 from cartopy.mpl.geoaxes import GeoAxes
     16 class _PlateCarreeFormatter(Formatter):
     17     """
     18     Base class for formatting ticks on geographical axes using a
     19     rectangular projection (e.g. Plate Carree, Mercator).
     20 
     21     """

File ~/anaconda3/envs/cf3/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py:43
     41 import cartopy.mpl.contour
     42 import cartopy.mpl.feature_artist as feature_artist
---> 43 import cartopy.mpl.geocollection
     44 import cartopy.mpl.patch as cpatch
     45 from cartopy.mpl.slippy_image_artist import SlippyImageArtist

File ~/anaconda3/envs/cf3/lib/python3.9/site-packages/cartopy/mpl/geocollection.py:13
      9 import numpy.ma as ma
     10 import packaging
---> 13 _MPL_VERSION = packaging.version.parse(mpl.__version__)
     16 def _split_wrapped_mesh_data(C, mask):
     17     """
     18     Helper function for splitting GeoQuadMesh array values between the
     19     pcolormesh and pcolor objects when wrapping.  Apply a mask to the grid
     20     cells that should not be plotted with each method.
     21 
     22     """

AttributeError: module 'packaging' has no attribute 'version'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions