Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

492
Visualizações
ImportError: cannot import name 'url_encode' from 'werkzeug'

I am currently running a conda environment with flask-wtf version 0.14.2 and wtforms version 2.21 and I have trouble solving this ImportError: cannot import name 'url_encode' from 'werkzeug'

The following code is the complete traceback.

Traceback (most recent call last):
      File "run.py", line 1, in <module>
        from flaskblog import app
      File "/Users/justinding/Desktop/test/test_wesite/flaskblog/__init__.py", line 10, in <module>
        from flaskblog import routes
      File "/Users/justinding/Desktop/test/test_wesite/flaskblog/routes.py", line 4, in <module>
        from flaskblog.forms import RegistrationForm,LoginForm
      File "/Users/justinding/Desktop/test/test_wesite/flaskblog/forms.py", line 1, in <module>
        from flask_wtf import FlaskForm
      File "/opt/anaconda3/envs/smartbox/lib/python3.7/site-packages/flask_wtf/__init__.py", line 17, in <module>
        from .recaptcha import *
      File "/opt/anaconda3/envs/smartbox/lib/python3.7/site-packages/flask_wtf/recaptcha/__init__.py", line 2, in <module>
        from .fields import *
      File "/opt/anaconda3/envs/smartbox/lib/python3.7/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
        from . import widgets
      File "/opt/anaconda3/envs/smartbox/lib/python3.7/site-packages/flask_wtf/recaptcha/widgets.py", line 5, in <module>
        from werkzeug import url_encode
    ImportError: cannot import name 'url_encode' from 'werkzeug' (/opt/anaconda3/envs/smartbox/lib/python3.7/site-packages/werkzeug/__init__.py)
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Setting werkzeug==0.16.1 in your requirements file fixes it. The issue is with the 1.0.0 version

over 4 years ago · Santiago Trujillo Relatório

0

guess the error is related to the new version of werkzeug. in new werkzeug version there is no "url_encode'. so try to install an older version of werkzeug like this : "pip install werkzeug==0.16.0" mine fixed with this solution

over 4 years ago · Santiago Trujillo Relatório

0

try to import this from werkzeug.urls

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda