Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?

前端 未结 17 1035
无人共我
无人共我 2020-11-22 16:34

I just installed Python 3.6.1 for MacOS X

When I attempt to run the Console(or run anything with Python3), this error is thrown:

  AttributeError: mo         


        
17条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 17:11

    Håken Lid's answer helped solved my problem (thanks!) , in my case present in Python3.7 running Flask in a Docker container (FROM tiangolo/uwsgi-nginx-flask:python3.7-alpine3.7).

    In my case, enum34 was being installed by another library (pip install smartsheet-python-sdk). For those coming with a similar Docker container problem, here is my final Dockerfile (stripped to the relevant lines):

    FROM tiangolo/uwsgi-nginx-flask:python3.7-alpine3.7
    ...
    RUN pip install -r requirements.txt
    RUN pip uninstall -y enum34
    ...
    

提交回复
热议问题