flask-migrate初学

来源:互联网 发布:python 日期减一天 编辑:程序博客网 时间:2024/06/08 11:30

flask在进行迁移的时候,有时候会出现问题

The directory '/home/python/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/python/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

在pycharm中显示报错

from flask_migrate import Migrate, MigrateCommand

很多时候会出现 flask_migrate 不可用

有可能是python-pip的版本问题,此时可以将原来的python-pip包删除:sudo apt-get remove python-pip

然后重新安装新版本的python-pip: 先下载新版本的python-pip的包:wget https://bootstrap.pypa.io/get-pip.py

然后重新安装: pip install Flask-Migrate==2.1.1

注意此处不能用sudo 

原创粉丝点击