当前位置:   article > 正文

深度学习之YOLOv5实践应用(5-1)WEB端部署(Flask+VUE)_can't uninstall 'markupsafe'. no files were found

can't uninstall 'markupsafe'. no files were found to uninstall.

源码参见:Yolov5-Flask-VUE:在WEB端部署YOLOv5目标检测模型-源码

一、Flask

参见 : 安装 — Flask 0.10.1 文档

1、sudo apt-get install python3-pip

2、sudo pip3 install Flask

  1. (yolov5) robot@robot-All-Series:~$ sudo pip3 install Flask
  2. Collecting Flask
  3. Downloading Flask-2.0.3-py3-none-any.whl (95 kB)
  4. |████████████████████████████████| 95 kB 659 kB/s
  5. Collecting Jinja2>=3.0
  6. Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
  7. |████████████████████████████████| 133 kB 317 kB/s
  8. Collecting itsdangerous>=2.0
  9. Downloading itsdangerous-2.1.1-py3-none-any.whl (15 kB)
  10. Collecting click>=7.1.2
  11. Downloading click-8.0.4-py3-none-any.whl (97 kB)
  12. |████████████████████████████████| 97 kB 416 kB/s
  13. Collecting Werkzeug>=2.0
  14. Downloading Werkzeug-2.0.3-py3-none-any.whl (289 kB)
  15. |████████████████████████████████| 289 kB 222 kB/s
  16. Collecting MarkupSafe>=2.0
  17. Downloading MarkupSafe-2.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
  18. Installing collected packages: MarkupSafe, Jinja2, itsdangerous, click, Werkzeug, Flask
  19. Attempting uninstall: MarkupSafe
  20. Found existing installation: MarkupSafe 1.1.0
  21. Not uninstalling markupsafe at /usr/lib/python3/dist-packages, outside environment /usr
  22. Can't uninstall 'MarkupSafe'. No files were found to uninstall.
  23. Attempting uninstall: click
  24. Found existing installation: Click 7.0
  25. Not uninstalling click at /usr/lib/python3/dist-packages, outside environment /usr
  26. Can't uninstall 'Click'. No files were found to uninstall.
  27. Successfully installed Flask-2.0.3 Jinja2-3.0.3 MarkupSafe-2.1.0 Werkzeug-2.0.3 click-8.0.4 itsdangerous-2.1.1

二、入门

快速入门 — Flask 0.10.1 文档

编写app.py

  1. from flask import Flask
  2. app = Flask(__name__)
  3. @app.route('/')
  4. def hello_world():
  5. return 'Hello World!'
  6. if __name__ == '__main__':
  7. app.run()

python3 app.py

提示错误,找不到库

  1. Traceback (most recent call last):
  2. File "/home/robot/flask-test/app.py", line 1, in <module>
  3. from flask import Flask
  4. ModuleNotFoundError: No module named 'flask

我用的anaconda虚拟环境。所以:

pip uninstall Flask && python3 -m pip install flask

然后重新执行

  1. (yolov5) robot@robot-All-Series:~/flask-test$ python3 app.py
  2. * Serving Flask app 'app' (lazy loading)
  3. * Environment: production
  4. WARNING: This is a development server. Do not use it in a production deployment.
  5. Use a production WSGI server instead.
  6. * Debug mode: off
  7. * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  8. 127.0.0.1 - - [11/Mar/2022 11:29:23] "GET / HTTP/1.1" 200 -
  9. 127.0.0.1 - - [11/Mar/2022 11:29:23] "GET /favicon.ico HTTP/1.1" 404 -

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/292210
推荐阅读
相关标签
  

闽ICP备14008679号