miguelgrinberg/two-factor-auth-flask

MarkupSafe throws error. Upgrading to newer version fixes it.

w-A-L-L-e opened this issue · 0 comments

pip install -r requirements.txt throws this error on macOS Big Sur:

 ERROR: Command errored out with exit status 1:
     command: /Users/wschrep/pythonWork/two-factor-auth-flask/python_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/68/c_pd8_vj55d9mdvv3mvllkh00000gn/T/pip-install-6ogd9rqk/MarkupSafe/setup.py'"'"'; __file__='"'"'/private/var/folders/68/c_pd8_vj55d9mdvv3mvllkh00000gn/T/pip-install-6ogd9rqk/MarkupSafe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/68/c_pd8_vj55d9mdvv3mvllkh00000gn/T/pip-pip-egg-info-ow2onn_4
         cwd: /private/var/folders/68/c_pd8_vj55d9mdvv3mvllkh00000gn/T/pip-install-6ogd9rqk/MarkupSafe/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/68/c_pd8_vj55d9mdvv3mvllkh00000gn/T/pip-install-6ogd9rqk/MarkupSafe/setup.py", line 6, in <module>
        from setuptools import setup, Extension, Feature
    ImportError: cannot import name 'Feature' from 'setuptools' (/Users/wschrep/pythonWork/two-factor-auth-flask/python_env/lib/python3.8/site-packages/setuptools/__init__.py)

Just changing this 1 line in requirements.txt to newer version of markupsafe fixes it for me. Maybe it can help others or maybe it can be changed in this repo? :

MarkupSafe==1.1.1

Other than that everything works great. I tested it with google authenticator app (instead of freeotp) that is suggested with an iphone and it also totally worked. Thanks for this nice example!