关于pip安装指定版本
Traceback (most recent call last): File "D:/code/p11/sylpro/main.py", line 2, in from flask_migrate import Migrate,MigrateCommandImportError: cannot import name 'MigrateCommand'
当遇到以上问题时,在已经确定了版本问题后,需要替换pip库版本
此时需要将版本切换过来,举例如下:
(venv) D:\code\p11\sylpro>pip install flask_script flask_migrate....(venv) D:\code\p11\sylpro>pip install flask-migrate==2.7.0....Installing collected packages: flask-migrate Attempting uninstall: flask-migrate Found existing installation: Flask-Migrate 4.0.1 Uninstalling Flask-Migrate-4.0.1: Successfully uninstalled Flask-Migrate-4.0.1Successfully installed flask-migrate-2.7.0
由上面额案例可以看出,在已经安装了flask-migrate较高本之后在安装相对低版本的,直接在后面接上*==版本号*,pip系统将直接强制卸载之前的版本,然后继续安装当前制定版本。
来源地址:https://blog.csdn.net/shunzi2016/article/details/131243689