Marco Ottina
Marco Ottina

Reputation: 589

RuntimeError: Python version 2.7 or 3.4+ is required even if I already have 3.10.6 version

I'm running the installer as described in the guide present in the LabelPC's GitHub page on Ubuntu 22.04, but I get the following error:

Collecting absl-py==0.8.0
  Using cached absl-py-0.8.0.tar.gz (102 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-_yo1tcdy/absl-py_761c46388aa14bfaac46b6c57352037a/setup.py", line 34, in <module>
          raise RuntimeError('Python version 2.7 or 3.4+ is required.')
      RuntimeError: Python version 2.7 or 3.4+ is required.
      [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.

I don't know how to fix it, since everything is updated. My Python version is 3.10.6

Upvotes: 10

Views: 11246

Answers (3)

goutam jain
goutam jain

Reputation: 11

the newer Python version has some issues I guess when I was installing some modules gives me some runtime error in Python version 3.11.* something then I resolved this error using the following command.

PS P:\gautam\rasa> python --version Python 3.10.10 PS P:\gautam\rasa> python -m pip install rasa --use-deprecated=legacy-resolver

Upvotes: 1

McAnix
McAnix

Reputation: 75

If reverting to 3.9 is not an option, you can use --ignore-requires-python with pip install to workaround the problem. It may have other unintended consequences, so test carefully.

Upvotes: 7

phd
phd

Reputation: 94827

This is a bug in abseil-py. Release 0.8 does Python version comparison this way. The comparison worked just fine for Pythons up to 3.9 but fails with 3.10+. When py_version is ('3', '10') the comparison returns False because in Python '10' is less then '4'; for strings Python compares '1' and '4'. (Integer 10 is of course > 4).

The bug was fixed in commit d61b0b6. Unfortunately labelpc requires exact version 0.8. This means that for now abseil-py and labelpc can be used with Python 2.7 and 3.5-3.9 but not with 3.10+.

Use Python 3.9 and report the bug.

Upvotes: 11

Related Questions