問(wèn)題描述
我正在嘗試使用 kaki帶有 kivy 和 python 的庫(kù),但要使用它,您需要運(yùn)行
I'm trying to use kaki library with kivy and python but to use it you need to run
DEBUG=1 python main.py
但我遇到了這個(gè)錯(cuò)誤
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
但我可以找到有關(guān)如何將此命令添加到我的路徑的任何來(lái)源
but I can find any source about how to add this command to my path
我正在使用
python:3.7
窗戶 10
python:3.7
windows 10
如果需要,我會(huì)添加任何信息
I will add any information if need it
推薦答案
在 PowerShell 中,您可以寫(xiě)入將由子進(jìn)程繼承的環(huán)境變量,如下所示:
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
或者作為一行中的兩個(gè)語(yǔ)句:
Or as two statements on a single line:
$env:DEBUG = 1; python main.py
Python 現(xiàn)在在解析 DEBUG
環(huán)境變量時(shí)將獲得值 1
Python will now get the value 1
when resolving the DEBUG
environment variable
在cmd.exe
中可以使用set
關(guān)鍵字:
C:> set "DEBUG=1" && python main.py
這篇關(guān)于向 Windows 添加“DEBUG=1"命令?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!