“烧瓶运行”在一个conda env中工作,但不在另一个环境中工作

时间:2019-07-19 18:04:08

标签: python flask conda

flask run在新的conda env中尝试时不起作用,但在较旧的conda env中可以正常工作。

我已经删除并重新创建了new-env,并重新安装了具有相同版本1.0.3的烧瓶。

(new-env) C:\Users\myname\PycharmProjects\myproject\backend>set FLASK_APP=my_app.py

(new-env) C:\Users\myname\PycharmProjects\myproject\backend>set FLASK_DEBUG=1

(new-env) C:\Users\myname\PycharmProjects\myproject\backend>flask run
 * Serving Flask app "my_app.py" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Restarting with stat
c:\users\myname\anaconda3\envs\new-env\python.exe: No module named C:\Users\myname\Anaconda3\envs\new-env\Scripts\flask

切换到较旧的conda env:

(old-env) C:\Users\myname\PycharmProjects\myproject\backend>flask run
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

0 个答案:

没有答案