flask-migrate初学

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 

你可能感兴趣的:(flask-migrate初学)