0

I'm trying to use kaki library with kivy and python but to use it you need to run

DEBUG=1 python main.py

but I'm facing this error

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

I'm using

python:3.7
windows 10

I will add any information if need it

Compo
  • 36,585
  • 5
  • 27
  • 39
Hussam F. Alkdary
  • 655
  • 1
  • 6
  • 21

1 Answers1

0

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 will now get the value 1 when resolving the DEBUG environment variable

In cmd.exe you can use the set keyword:

C:\> set "DEBUG=1" && python main.py
mklement0
  • 382,024
  • 64
  • 607
  • 775
Mathias R. Jessen
  • 157,619
  • 12
  • 148
  • 206
  • its possible to do this without using PowerShell because it difficult to use – Hussam F. Alkdary Sep 28 '21 at 14:59
  • actually PowerShell is much easier to use because it doesn't have the legacy quirks in cmd. @MathiasR.Jessen that won't work because spaces in cmd are important. You need `set "DEBUG=1" && python main.py` – phuclv Sep 28 '21 at 15:09