add `DEBUG=1` commands to windows?(向 Windows 添加“DEBUG=1命令?)
问题描述
我正在尝试使用 kaki带有 kivy 和 python 的库,但要使用它,您需要运行
I'm trying to use kaki library with kivy and python but to use it you need to run
DEBUG=1 python main.py
但我遇到了这个错误
DEBUG=1 : The term 'DEBUG=1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ DEBUG=1 python main.py
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (DEBUG=1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
但我可以找到有关如何将此命令添加到我的路径的任何来源
but I can find any source about how to add this command to my path
我正在使用
python:3.7
窗户 10
python:3.7
windows 10
如果需要,我会添加任何信息
I will add any information if need it
推荐答案
在 PowerShell 中,您可以写入将由子进程继承的环境变量,如下所示:
In PowerShell, you can write to an environment variable which will be inherited by child processes, like this:
PS ~> $env:DEBUG = 1
PS ~> python main.py
或者作为一行中的两个语句:
Or as two statements on a single line:
$env:DEBUG = 1; python main.py
Python 现在在解析 DEBUG
环境变量时将获得值 1
Python will now get the value 1
when resolving the DEBUG
environment variable
在cmd.exe
中可以使用set
关键字:
C:> set "DEBUG=1" && python main.py
这篇关于向 Windows 添加“DEBUG=1"命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:向 Windows 添加“DEBUG=1"命令?


基础教程推荐
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 筛选NumPy数组 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01