Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError in ChemEx with Matplotlib 3.9 #233

Closed
gbouvignies opened this issue May 29, 2024 · 0 comments · Fixed by #234
Closed

ImportError in ChemEx with Matplotlib 3.9 #233

gbouvignies opened this issue May 29, 2024 · 0 comments · Fixed by #234
Assignees

Comments

@gbouvignies
Copy link
Owner

Description:
When running ChemEx, an ImportError occurs due to the get_cmap function not being found in matplotlib.cm. This issue seems related to the use of Matplotlib 3.9.

Traceback:

Traceback (most recent call last):
  File "/Users/gbouvignies/Code/ChemEx/.venv/bin/chemex", line 5, in <module>
    from chemex.chemex import main
  File "/Users/gbouvignies/Code/ChemEx/chemex/chemex.py", line 23, in <module>
    from chemex.optimize.fitting import run_methods
  File "/Users/gbouvignies/Code/ChemEx/chemex/optimize/fitting.py", line 21, in <module>
    from chemex.optimize.gridding import run_grid
  File "/Users/gbouvignies/Code/ChemEx/chemex/optimize/gridding.py", line 12, in <module>
    from matplotlib.cm import get_cmap
ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' (/Users/gbouvignies/Code/ChemEx/.venv/lib/python3.12/site-packages/matplotlib/cm.py)

Steps to Reproduce:

  1. Install Matplotlib 3.9.
  2. Run ChemEx.
  3. Observe the ImportError in the traceback.

Expected Behavior:
ChemEx should import get_cmap from matplotlib.cm without errors.

Environment:

  • ChemEx version: 2024.5.0
  • Matplotlib version: 3.9
  • Python version: 3.12
  • OS: MacOS 14.5

Additional Context:
This issue likely stems from changes in the Matplotlib 3.9 update. Reverting to an earlier version of Matplotlib may be a temporary workaround.

@gbouvignies gbouvignies self-assigned this May 29, 2024
gbouvignies added a commit that referenced this issue May 29, 2024
gbouvignies added a commit that referenced this issue May 29, 2024
* ImportError in ChemEx with Matplotlib 3.9
Fixes #233

* Fix the Logo at startup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant