Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

497
Views
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 answers
Answer question

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 Report

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 Report

0

try to import this from werkzeug.urls

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!