将 `DEBUG=1` 命令添加到 windows?
add `DEBUG=1` commands to windows?
我正在尝试使用 kaki
带有 kivy 和 python 的库,但要使用它你需要 运行
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
但我可以找到有关如何将此命令添加到我的路径的任何资源
我正在使用
python:3.7
windows10
如果需要我会添加任何信息
在 PowerShell 中,您可以写入将由子进程继承的环境变量,如下所示:
PS ~> $env:DEBUG = 1
PS ~> python main.py
或者作为一行中的两个语句:
$env:DEBUG = 1; python main.py
Python 现在将在解析 DEBUG
环境变量时获得值 1
在 cmd.exe
中您可以使用 set
关键字:
C:\> set "DEBUG=1" && python main.py
我正在尝试使用 kaki 带有 kivy 和 python 的库,但要使用它你需要 运行
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
但我可以找到有关如何将此命令添加到我的路径的任何资源
我正在使用
python:3.7
windows10
如果需要我会添加任何信息
在 PowerShell 中,您可以写入将由子进程继承的环境变量,如下所示:
PS ~> $env:DEBUG = 1
PS ~> python main.py
或者作为一行中的两个语句:
$env:DEBUG = 1; python main.py
Python 现在将在解析 DEBUG
环境变量时获得值 1
在 cmd.exe
中您可以使用 set
关键字:
C:\> set "DEBUG=1" && python main.py