On a Linux session I can set an environment variable like
export PYTHONPATH=.
How to do that on a windows Powershell? I found THIS and tried
[Environment]::SetEnvironmentVariable PYTHONPATH=.
and
$env PYTHONPATH=.
but neither did not work. In both cases I got an error UnexpectedToken.
$env:PYTHONPATH = $pwd
You forgot a colon in the last version. Also the . doesn't work here, but you can use the built-in variable $pwd (current directory).
I find $env:NAME the easiest way to get environment variables in Powershell. It also follows the Microsoft documentation: about_Environment_Variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With