如何解决如何在虚拟环境中使用 Python 编写打包任务?
我想做这个
我尝试通过阅读此站点来打包 python 代码。
https://packaging.python.org/tutorials/packaging-projects/
当然,我可以手动完成。不过,我想从第二次开始更容易一些。
我尝试了什么
.vscode/tasks.json
是这个。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0","tasks": [
{
"label": "build","type": "shell","command": "python -m build"
}
]
}
测试结果
如你所想,这个任务失败了。
> Executing task: python -m build <
Python was not found; run without arguments to install from the Microsoft Store,or disable this shortcut from Settings > Manage App Execution Aliases.
The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command python -m build" terminated with exit code: 1.
Terminal will be reused by tasks,press any key to close it.
我想要的答案
是否可以在虚拟环境中避免指定绝对路径而指定Python?
有更好的方法吗?
环境
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。