adafruit / Adafruit_CircuitPython_SCD30

Helper library for the SCD30 e-CO2 sensor
MIT License
15 stars 10 forks source link

Python 3.9: AttributeError: 'HTMLParser' object has no attribute 'unescape' #30

Open Firesphere opened 2 years ago

Firesphere commented 2 years ago

unescape has been removed from Python3.9 distlib, causing the installation to fail.

More: https://bugs.python.org/issue19688

tekktrik commented 2 years ago

I was just able to install with 3.9.7 via pip, can you post your install error?

Firesphere commented 2 years ago
Requirement already satisfied: adafruit-circuitpython-dht in ./venv/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (3.7.1)
Collecting adafruit-circuitpython-scd30
  Using cached adafruit-circuitpython-scd30-2.2.2.tar.gz (30 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      Traceback (most recent call last):
        File "/home/simonerkelens/Projects/environment-readings/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/simonerkelens/Projects/environment-readings/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/simonerkelens/Projects/environment-readings/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 124, in get_requires_for_build_wheel
          backend = _build_backend()
        File "/home/simonerkelens/Projects/environment-readings/venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 89, in _build_backend
          obj = import_module(mod_path)
        File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
        File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 850, in exec_module
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 14, in <module>
          from setuptools.dist import Distribution, Feature
        File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
        File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
        File "/home/simonerkelens/Projects/environment-readings/venv/lib/python3.9/site-packages/_virtualenv.py", line 89, in exec_module
          old(module)
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 24, in <module>
          from setuptools.depends import Require
        File "/usr/lib/python3/dist-packages/setuptools/depends.py", line 7, in <module>
          from .py33compat import Bytecode
        File "/usr/lib/python3/dist-packages/setuptools/py33compat.py", line 54, in <module>
          unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
      AttributeError: 'HTMLParser' object has no attribute 'unescape'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
tekktrik commented 2 years ago

Try upgrading pip, setuptools and distlib

I think specifically it's setuptools that is having the issue

Firesphere commented 2 years ago

Already have done so before that run posted, with no change, sadly :(