Please help me error start python 3.11

Intaraprasert, Pramote 0 Reputation points
2024-02-12T05:43:53.1033333+00:00

My project is developed with python 3.11 with the startup.txt file settings as follows

gunicorn --bind 0.0.0.0 --timeout 600 application:app

Previously I was able to run it normally but now when I deploy it, I don't know what problem is causing the error according to the Log stream below.

2024-02-12T06:15:06.918134335Z File "/tmp/8dc2b8a606ee615/antenv/bin/gunicorn", line 3, in <module> 2024-02-12T06:15:06.918143472Z import re 2024-02-12T06:15:06.918602589Z File "/opt/python/3.11.4/lib/python3.11/re/init.py", line 140, in <module> 2024-02-12T06:15:06.919154920Z @enum.global_enum 2024-02-12T06:15:06.919178004Z ^^^^^^^^^^^^^^^^ 2024-02-12T06:15:06.919777935Z AttributeError: module 'enum' has no attribute 'global_enum'

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
900 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,886 Reputation points
    2024-02-12T21:34:21.47+00:00

    Hello @Intaraprasert, Pramote

    The error message AttributeError: module 'enum' has no attribute 'global_enum' suggests that the Python interpreter is trying to access an attribute global_enum in the enum module, which doesn’t exist.

    This error can occur if there’s a naming conflict between the standard library’s enum module and another file or module in your project named enum. If there’s a file named enum.py in your project or in your Python path, it could be shadowing the standard library’s enum module To help resolve this issue make sure there’s no file or module named enum in your project or in your Python path. Also looking into your environment variables, such as PYTHONPATH, do not point to a location that includes a conflicting enum modue. Lastly, If you’re using any third-party libraries that depend on the enum34 backport module, they could be causing a conflict. The enum34 module is not compatible with Python 3.6 and later, and can shadow the built-in enum module. If this is the case, you can uninstall enum34 using pip: pip uninstall -y enum34 Best,

    -Grace

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.