webcompat / webcompat.com

Source code for webcompat.com
https://webcompat.com
353 stars 187 forks source link

Missing dependency when installing with Python 3.12 #3810

Open dannycolin opened 5 months ago

dannycolin commented 5 months ago

Description

After following the instruction to install the local dev environment, I tried to run npm run start and got the following error:

Error: While importing 'webcompat', an ImportError was raised:

Traceback (most recent call last):
  File "/home/dcolin/Projects/webcompat.com/env/lib64/python3.12/site-packages/flask/cli.py", line 256, in locate_app
    __import__(module_name)
  File "/home/dcolin/Projects/webcompat.com/webcompat/__init__.py", line 14, in <module>
    from flask_limiter import Limiter
  File "/home/dcolin/Projects/webcompat.com/env/lib64/python3.12/site-packages/flask_limiter/__init__.py", line 3, in <module>
    from .errors import RateLimitExceeded
  File "/home/dcolin/Projects/webcompat.com/env/lib64/python3.12/site-packages/flask_limiter/errors.py", line 3, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

This happens because the distutils package has been removed from the standard library in Python 3.12.

Solution

Adding setuptools as a dev dependency solve this problem since it includes distutils.