ImportError: cannot import name 'SharedDataMiddleware' from 'werkzeug'

Ask Questions Forum: ask Machine Learning Questions to our readersCategory: Machine LearningImportError: cannot import name 'SharedDataMiddleware' from 'werkzeug'
Adesoji Alu asked 2 months ago

def uploaded_file(filename):
return send_from_directory(app.config[‘UPLOAD_FOLDER’],
from werkzeug import SharedDataMiddleware
app.add_url_rule(‘/uploads/’, ‘uploaded_file’,
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
‘/uploads’: app.config[‘UPLOAD_FOLDER’]

if __name__ == “__main__”:
app.debug=False’′, port=3000)

Error below
File “C:\Users\Sortol\Downloads\Compressed\AIFlowers2-master\”, line 94, in
from werkzeug import SharedDataMiddleware
ImportError: cannot import name ‘SharedDataMiddleware’ from ‘werkzeug’ (C:\Users\Sortol\anaconda3\lib\site-packages\werkzeug\

Please what did i do wrong. i have the module werkzeug installed.

2 Answers
Best Answer
Adesoji answered 1 month ago

solved by importing rightly. from werkzeug.middleware.shared_data import SharedDataMiddleware

Adesoji answered 1 month ago

from werkzeug.middleware.shared_data import SharedDataMiddleware

Your Answer

15 + 10 =