||
(1)命令行执行flask app
Open Command Prompt and navigate to your project directory. You can do this with the command cd c:your_project_folder_destination on Windows.
Run command: set FLASK_APP=main.py
Run command: set FLASK_DEBUG=1
Run command: flask run
(2).venvScriptsactivate : 无法加载文件 ...因为在此系统上禁止运行脚本。
在vscode中终端选择powershell执行set-executionpolicy remotesigned即可解决。
转自:https://blog.csdn.net/qq_17802895/article/details/126349428
(3)由于python插件升级,setting.json里的内容改为:
{
"python.defaultInterpreterPath":".venv\Scripts\python.exe"
}
(4)vscode使用code runner插件运行乱码以及报错No module named ‘XXX’问题
(1)解决方式是打开文件--首选项--设置,在设置中搜索code-runner.executorMap,点击在settings.json中编辑
(2)把python的值改为;set PYTHONIOENCODING=utf8 && pythonPathfullFileName
(3)输出正常
转自:https://blog.csdn.net/jiaweide123/article/details/110199079
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-2 23:47
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社