WTOAAM =============== 风力发电机组运行分析算法模型 Wind turbine operation analysis algorithm model # django auth http://127.0.0.1/admin 账号 admin 密码 root.123456 # 附加进程调试 ## 安装debugpy pip install --upgrade debugpy ## 运行程序命令 机组发电性能分析算法v1.1 示例: python -m debugpy --listen localhost:5678 --wait-for-client e:/WorkSpace/SourceCode/WTOAAM/wtoaamapi/apps/business/main.py 机组发电性能分析算法v1.2 调试示例: python -m debugpy --listen localhost:5678 .\wtoaamapi\manage.py runserver 0.0.0.0:8000 运行示例: python .\wtoaamapi\manage.py runserver 0.0.0.0:8000 ## 附加进程 配置launch.json文件,内容如下: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: Remote Attach", // 远程调试 "type":"debugpy", "request": "attach", "connect": { "host": "localhost", "port": 5678 }, "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "." } ], "justMyCode": false } ] } 打开要调试的源代码文件,在vscode搜索框选择"开始调试 debug","Python: Remote Attach"即lanuch.json文件中configurations[0].name节点值即可。 ## pip 包管理清理缓存 pip cache purge ## 打包为wheel及安装 pip uninstall [包名] 示例:pip uninstall dataAnalysisBusiness python setup.py bdist_wheel 说明:在对应包的路径下执行此命令 pip install --force-reinstall ./dist/*.whl 说明:在对应包的路径下执行此命令 示例:pip install --force-reinstall dist/dataAnalysisBusiness-1.2.202406281547-py3-none-any.whl ## 第三方包版本冲突 # 解决windows环境plotly 包write_image方法 阻塞,使用如下包及版本: kaleido==0.1.0.post1 plotly==5.19.0 plotly-express==0.4.1 # 更新加载文件夹模块命令: 1、安装build包:pip insatall build 2、进入文件夹路径下运行python -m build命令,生成.whl文件和.tar.gz文件 3、加载生成的.whl文件:pip install dist/dataAnalysisBusiness-1.2.202501161710-py3-none-any.whl(根据实际修改) 4、加载完成继续测试