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

ModuleNotFoundError: No module named 'pkg_resources' #59

Closed
FlorentinD opened this issue Dec 6, 2024 · 2 comments
Closed

ModuleNotFoundError: No module named 'pkg_resources' #59

FlorentinD opened this issue Dec 6, 2024 · 2 comments

Comments

@FlorentinD
Copy link

FlorentinD commented Dec 6, 2024

First of all, thank you for this extensive collection!

Using version 3.3.0.
We hit the following issue on trying to import a palette from the package

>       from palettable.wesanderson import Moonrise1_5

tests/test_colors.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../.venv311/lib/python3.11/site-packages/palettable/__init__.py:10: in <module>
    from . import colorbrewer
../.venv311/lib/python3.11/site-packages/palettable/colorbrewer/__init__.py:3: in <module>
    from .colorbrewer import *
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    from __future__ import absolute_import
    from __future__ import print_function
    
    import json
    import webbrowser
    
>   from pkg_resources import resource_string
E   ModuleNotFoundError: No module named 'pkg_resources'

../.venv311/lib/python3.11/site-packages/palettable/colorbrewer/colorbrewer.py:7: ModuleNotFoundError

Our workaround was to install setuptools, but reading up on https://setuptools.pypa.io/en/latest/pkg_resources.html, it should be possible to replace the usage of pkg_resources as well.
However, I cannot even find the import in the source code?

@jiffyclub
Copy link
Owner

jiffyclub commented Dec 8, 2024

Hi, thanks for the report! It looks like importib.resources provides this functionality in the standard library now, I'll have to look into updating that.

@jiffyclub
Copy link
Owner

Actually, looking deeper into this, this was fixed in #46. Those changes were released in version 3.3.1, so if you update to the latest version you shouldn't run into this issue.

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

No branches or pull requests

2 participants