Requirement already satisfied: flask in /usr/local/lib64/python3.6/site-packages

问题描述

执行

pm2 start -s --name=hello hello.py

服务器没有启动成功

pm2 日志:

vim ~/.pm2/logs/hello-error.log
Traceback (most recent call last):
  File "/data/pai_mate_workspaces/pai-mate-hello-example-py/hello.py", line 1, in 
    from flask import Flask
ImportError: No module named flask

python 没有运行成功的原因是因为 flask 没有安装,没有安装的原因是:

Requirement already satisfied: flask in /usr/local/lib64/python3.6/site-packages

所以在 .venv/lib/python3.6/site-packages 中没有找到 flask

Requirement already satisfied: flask in /usr/local/lib64/python3.6/site-packages_第1张图片

解决

卸载掉当前的 flask

你可能感兴趣的:(Python)