Frappe installation fails on Python 3.10 and 3.11

Hello community,
I wanted to ask you what is the best way to go about installing frappe framework
if I get:


    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [12 lines of output]
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 14, in <module>
          File "/home/mark/.local/lib/python3.10/site-packages/setuptools/__init__.py", line 20, in <module>
            from setuptools.dist import Distribution, Feature
          File "/home/mark/.local/lib/python3.10/site-packages/setuptools/dist.py", line 35, in <module>
            from setuptools.depends import Require
          File "/home/mark/.local/lib/python3.10/site-packages/setuptools/depends.py", line 7, in <module>
            from .py33compat import Bytecode
          File "/home/mark/.local/lib/python3.10/site-packages/setuptools/py33compat.py", line 55, in <module>
            unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
        AttributeError: 'HTMLParser' object has no attribute 'unescape'

I’ve upgraded setuptools module as well as pip and I get this error on Python 3.10 as well as python 3.11

I’m on Ubuntu 20.04

Thank you for suggestions.

Edit:

Based on online forums it appears that setuptools work only up to Python3.8, however frappe frameworks requires Python 10 and above. What should I do ?

Hi,

It may help to say the version of frappe and how python 10 and 11 are being installed.

I’m getting frappe by cloning git clone https://github.com/frappe/bench /home/mark/.bench --depth 1 --branch master which I think is latest version on the master. 14.27 I believe. I installed python versions by adding deadsnakes repo and running sudo apt install python3.10-full

Hope this helps.

Does python3 -V confirm one of those is in use?
Has sudo pip3 install frappe-bench been tried?

Problem resolved after running sudo apt install python3.8-setuptools apparently running pip3 install setuptools --upgrade isn’t the same.