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

No longer be able to install label-studio in Python 3.13 #6506

Open
nekomeowww opened this issue Oct 12, 2024 · 1 comment
Open

No longer be able to install label-studio in Python 3.13 #6506

nekomeowww opened this issue Oct 12, 2024 · 1 comment

Comments

@nekomeowww
Copy link

Describe the bug

Python 3.13 is released at Oct 7, currently, we can no longer install label-studio in Python 3.13:

> which pip
/opt/homebrew/Caskroom/miniforge/base/envs/labelstudio-cgi-repro/bin/pip

> pip install label-studio
Collecting label-studio
  Downloading label_studio-1.13.1-py3-none-any.whl.metadata (14 kB)
# many other dependencies...
Collecting htmlmin==0.1.12 (from label-studio)
  Downloading htmlmin-0.1.12.tar.gz (19 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
          exec(compile('''
          ~~~~^^^^^^^^^^^^
          # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ...<31 lines>...
          exec(compile(setup_py_code, filename, "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ''' % ('/private/var/folders/m0/k_38ftb53yg0mqbcrrjypr3m0000gn/T/pip-install-6ttnzd70/htmlmin_d451826247444646a2c06bbaea3ec118/setup.py',), "<pip-setuptools-caller>", "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/m0/k_38ftb53yg0mqbcrrjypr3m0000gn/T/pip-install-6ttnzd70/htmlmin_d451826247444646a2c06bbaea3ec118/setup.py", line 4, in <module>
          from htmlmin import __version__
        File "/private/var/folders/m0/k_38ftb53yg0mqbcrrjypr3m0000gn/T/pip-install-6ttnzd70/htmlmin_d451826247444646a2c06bbaea3ec118/htmlmin/__init__.py", line 28, in <module>
          from .main import minify, Minifier
        File "/private/var/folders/m0/k_38ftb53yg0mqbcrrjypr3m0000gn/T/pip-install-6ttnzd70/htmlmin_d451826247444646a2c06bbaea3ec118/htmlmin/main.py", line 28, in <module>
          import cgi
      ModuleNotFoundError: No module named 'cgi'
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

To Reproduce

  1. mamba create -n labelstudio-cgi-repro python=3.13 -y
  2. mamba activate labelstudio-cgi-repro
  3. pip install label-studio
  4. See error

Expected behavior

With the release note says (https://docs.python.org/3/whatsnew/3.13.html), due to the suggested PEP 594 – Removing dead batteries from the standard library:

The remaining 19 “dead batteries” (legacy stdlib modules) have been removed from the standard library: aifc, audioop, cgi, cgitb, chunk, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu and xdrlib.

Therefore all the dependencies that used the deprecated std libs will throw this error.

The htmlmin is used in label-studio, it seems the currect active module is htmlmin2 instead of htmlmin from test with 3.13 by Remi-Gau · Pull Request #32 · christiansandberg/pytest-reporter-html1 as well as mentioning at Deprecation Warning: 'cgi' is deprecated and slated for removal in Python 3.13 · Issue #66 · mankyd/htmlmin.

Not sure what is the best move, can I just replace the htmlmin wth htmlmin2? Many of other dependencies are not yet tested completely.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS 14.3.1 (23D60)
  • Python: 3.13.0 (h4862095_100_cp313)
  • Label Studio Version 1.13.1 (label_studio-1.13.1-py3-none-any.whl)

Additional context

@danielcuque
Copy link

I have the same problem :/

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