说明:https://mp.weixin.qq.com/s/U0a44nY6oIOnrPLS1V1RWg
参考代码:https://github.com/mnguyenngo/flask-rest-setup/tree/master/sentiment-clf
搭建环境:
1)创建工程:
新建 flask 工程 project
cd 到工程 project 目录下
右键单击 Git bash here
2) 搭建属于自己的 python 环境
在 git 命令行输入:
virtualenv py36_flask
激活新环境:
source ./project/py36_flask/Scripts/activate
安装包和依赖:
pip install flask-restful
pip install -r requirements.txt 或者 python -m pip install -r requirements.txt
退出新环境:
cd 到 project/py36_flask/Scripts/ 下
在 git 命令中输入:
deactivate
3) 在 pycharm 中,把解释器配置为 py36_flask 中的环境。
将机器学习模型部署为 REST API_搭建自己的 python 环境
最新推荐文章于 2023-05-31 17:02:48 发布