The package for Flask-Uploads
on PyPi is broken since February 2020 when Werkzeug
changed its API, thus the error message you see.
You can either install Flask-Uploads
directly from GitHub or instead of Flask-Uploads
install Flask-Reuploaded
which is a compatible drop-in replacement.
https://pypi.org/project/Flask-Reuploaded/
As of Oct 5th, 2020, there is no "get started" guide on Flask-Reuploaded
s README page, that's correct.
As stated in the https://flask-reuploaded.readthedocs.io/en/latest/ and as you tried already, you just have to install Flask-Reuploaded
and then e.g. do a from flask_uploads import Uploadset
.
Please note it is from flask_uploads...
not from flask_reuploaded
. That is done on purpose to be 100% compatible with Flask-Uploads
.
When you experience an error like No module named 'flask_uploads'
this strongly indicates one of two possible problems:
- you did not install
Flask-Reuploaded
- you installed it, but not in the same virtual environment as
Flask
Please make sure to install both packages into the same virtual environment
.
To prove it... do a pip freeze
- for me that would look like the following...
~/Projects/example_flask_reuploaded took 10s
❯ pip freeze
click==7.1.2
Flask==1.1.2
Flask-Reuploaded==0.3.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1
That all said - I will update the README section of Flask-Reuploaded
as soon as possible.
Update, January 18th, 2021
I have updated the README of Flask-Reuploaded
with more clear information how to get a project started.
https://github.com/jugmac00/flask-reuploaded/blob/master/README.rst