question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name url_encode

See original GitHub issue

I’m facing the following error when trying to run knowledge-repo==0.8.8.

knowledge_repo --repo . runserver --config config.py --port 7000:

Traceback (most recent call last):
  File "/home/kelvins/luizalabs/heisenberg/venv/bin/knowledge_repo", line 300, in <module>
    from knowledge_repo.app.deploy import KnowledgeDeployer, get_app_builder
  File "/home/kelvins/luizalabs/heisenberg/venv/lib/python3.6/site-packages/knowledge_repo/app/__init__.py", line 4, in <module>
    from .app import KnowledgeFlask
  File "/home/kelvins/luizalabs/heisenberg/venv/lib/python3.6/site-packages/knowledge_repo/app/app.py", line 20, in <module>
    from werkzeug import url_encode
ImportError: cannot import name 'url_encode'

It seems knowledge-repo does not pin the Werkzeug version and Werkzeug has released a new version 1.0.0 that breaks the retro compatibility (issue: https://github.com/pallets/werkzeug/issues/1714).

$ pip show werkzeug

Name: Werkzeug
Version: 1.0.0
Summary: The comprehensive WSGI web application library.
Home-page: https://palletsprojects.com/p/werkzeug/
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD-3-Clause
Location: /home/kelvins/luizalabs/heisenberg/venv/lib/python3.6/site-packages
Requires: 
Required-by: knowledge-repo, Flask

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bartaeltermancommented, Feb 14, 2020
0reactions
kelvinscommented, May 6, 2020

I believe this issue was fixed by PR https://github.com/airbnb/knowledge-repo/pull/537, so I’m closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot import name 'urlencode' when trying to install flask.ext ...
The urllib module has been split into parts and renamed in Python 3 to urllib.request, urllib.parse, and urllib.error.
Read more >
Fixing ImportError: cannot import name 'urlencode' in Python3
Solution: As described by Fred Foo here on StackOverflow, Python3 contains urlencode() not in the urllib module but in urllib. parse .
Read more >
ImportError: cannot import name urlencode on python2 #756
To install from the repository, just clone the repo (with git clone https://github.com/nficano/pytube ), then navigate to the directory it's ...
Read more >
cannot import name 'urlencode' when trying to install flask.ext ...
Coding example for the question ImportError: cannot import name 'urlencode' when trying to install flask.ext.storage.
Read more >
python3 导入from urllib import urlencode 报错 ... - CSDN博客
I have observed the following behavior in python 3.4.2, and I am unableto explain it. Hopefully someone could shed some light on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found