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' #191

Closed
harupong opened this issue Dec 7, 2024 · 2 comments
Closed

ModuleNotFoundError: No module named 'pkg_resources' #191

harupong opened this issue Dec 7, 2024 · 2 comments

Comments

@harupong
Copy link
Contributor

harupong commented Dec 7, 2024

I have a scheduled job on GitHub Actions to setup & run withings-sync twice a day, and it stopped working one week ago.

From the GitHub Actions log, I found out that setuptools was not installed by simply running pip install withings-sync during setup, thus the error “ModuleNotFoundError: No module named 'pkg_resources’” when running withings-sync.

I added a step to install setuptools in my GitHub Actions yaml file as well during setup, and it worked fine.

Is this the expected behavior? My environment is as follows.

Python: 3.12.7
withings-sync: 4.2.7
OS: Ubuntu 22.04.5

@stynoo
Copy link
Contributor

stynoo commented Dec 7, 2024

Yes it is, your github actions probably upgraded from an older python version to 3.12.

Python 3.12 has removed pkg_resources from the standard library (moved to setuptools):
https://docs.python.org/3/whatsnew/3.12.html

gh-95299: Do not pre-install setuptools in virtual environments created with venv. This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environment.

@harupong
Copy link
Contributor Author

@stynoo
Understood. Thanks for the clarification. My bad that I upgraded Python to 3.12 w/o taking a closer look first.

BTW, thank you so much for all the time and effort you and @longstone are putting into this project. I really appreciate it.

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