-1

I'm getting errors with installing rasa via pip. The error message is shown as below, and it seems to suggest that my Python version isn't applicable, but my Python version is 3.11.3, which is definitely above 3.4. Does anyone have any suggestions on what this could be?

Collecting rasa
  Using cached rasa-1.10.2-py3-none-any.whl (510 kB)
Collecting PyJWT<1.8,>=1.7 (from rasa)
  Using cached PyJWT-1.7.1-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: SQLAlchemy<1.4.0,>=1.3.3 in c:\users\ayu\appdata\roaming\python\python311\site-packages (from rasa) (1.3.24)
Collecting absl-py<0.10,>=0.9 (from rasa)
  Using cached absl-py-0.9.0.tar.gz (104 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 "C:\Users\albertgranz\App\Local\Temp\pip-install-ctiigi8b\absl-py_f74b78151a764aaaabe5f2a103d08a3d\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.

1 Answers1

3

This is caused by an incorrect version comparison in the setup.py of absl-py-0.9.0.tar.gz which contains the line

py_version = platform.python_version_tuple()
if py_version < ('2', '7') or py_version[0] == '3' and py_version < ('3', '4'):
  raise RuntimeError('Python version 2.7 or 3.4+ is required.')

platform.python_version_tuple() is a tuple that is ('3', '11', '4'). Due to the way tuple comparison works in python ('3', '11', '4') < ('3', '4') evaluates to True. I would recommend:

  1. Download absl-py-0.9.0.tar.gz from pypi
  2. Extract the content, open the setup.py and comment the above mentioned lines
  3. Run python setup.py install in the extracted directory

which manually disables this error.

Note rasa - which you originally tried to install does not seem to be tested or doesn't support python 3.11, because its dependencies cannot be installed without manual work. It might still work, but more likely, you will have to downgrade your python version

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
  • And maybee go mock whoever doesn't update there dependencies for 'absl-py' since it's fixed a long time now https://github.com/abseil/abseil-py/issues/161 ;) – Sifi_crafter Aug 22 '23 at 08:24