我正在做一个烧瓶项目。这些是我在 requirements.txt 中的依赖项,它工作正常:
pytest==6.2.4
black==21.7b0
Flask-JWT-Extended==4.2.3
Flask-RESTful==0.3.9
Flask-SQLAlchemy==2.5.1
PyMySQL==1.0.2
Flask-MySQLdb==0.2.0
flask-marshmallow==0.14.0
marshmallow-sqlalchemy==0.26.1
marshmallow
flask-uploads==0.2.1
Werkzeug==0.16.0
python-dotenv==0.19.0
flask-migrate==3.1.0
ldap3==2.9.1
psycopg2==2.9.1
Werkzeug==0.16.0
StackOverflow 中的这篇文章解释了我使用的原因:
flask_uploads:ImportError:无法导入名称“secure_filename”
我正在尝试使用 pipenv 而不是 venv。
因此,在创建项目并将 pipfile 添加到项目后,我运行以下命令:
pipenv install -r requirements.txt
但我收到一个错误:
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Could not find a version that matches werkzeug==0.16.0,>=0.14,>=2.0 (from -r C:\Users\{user}\AppData\Local\Temp\pipenv4r7ldp86requirements\pipenv-ajg0yy6e-constraints.txt (line 15))
Tried: 0.1, 0.2, 0.3, 0.3.1, 0.4, 0.4.1, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.8.2, 0.8.3, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.10, 0.10.1, 0.10.2, 0.10.2, 0.10.4, 0.10.4, 0.11, 0.11, 0.11.1, 0.11.
1, 0.11.2, 0.11.2, 0.11.3, 0.11.3, 0.11.4, 0.11.4, 0.11.5, 0.11.5, 0.11.6, 0.11.6, 0.11.7, 0.11.7, 0.11.8, 0.11.8, 0.11.9, 0.11.9, 0.11.10, 0.11.10, 0.11.11, 0.11.11, 0.11.12, 0.11.12, 0.11.13, 0.11.13, 0.11.14, 0.11.14, 0.11.15, 0.11.
15, 0.12, 0.12, 0.12.1, 0.12.1, 0.12.2, 0.12.2, 0.13, 0.13, 0.14, 0.14, 0.14.1, 0.14.1, 0.15.0, 0.15.0, 0.15.1, 0.15.1, 0.15.2, 0.15.2, 0.15.3, 0.15.3, 0.15.4, 0.15.4, 0.15.5, 0.15.5, 0.15.6, 0.15.6, 0.16.0, 0.16.0, 0.16.1, 0.16.1, 1.0
.0, 1.0.0, 1.0.1, 1.0.1, 2.0.0, 2.0.0, 2.0.1, 2.0.1
Skipped pre-versions: 1.0.0rc1, 1.0.0rc1, 2.0.0rc1, 2.0.0rc1, 2.0.0rc2, 2.0.0rc2, 2.0.0rc3, 2.0.0rc3, 2.0.0rc4, 2.0.0rc4, 2.0.0rc5, 2.0.0rc5
There are incompatible versions in the resolved dependencies:
werkzeug==0.16.0 (from -r C:\Users\{user}\AppData\Local\Temp\pipenv4r7ldp86requirements\pipenv-ajg0yy6e-constraints.txt (line 15))
werkzeug>=0.14 (from flask-jwt-extended==4.2.3->-r C:\Users\{user}\AppData\Local\Temp\pipenv4r7ldp86requirements\pipenv-ajg0yy6e-constraints.txt (line 3))
werkzeug>=2.0 (from flask==2.0.1->flask-migrate==3.1.0->-r C:\Users\{user}\AppData\Local\Temp\pipenv4r7ldp86requirements\pipenv-ajg0yy6e-constraints.txt (line 7))
我怎么解决这个问题?