如何在 Windows 10 VS Code 或 PyCharm 终端中查看我的环境变量?

How do i view my environment variables in Windows 10 VS Code or PyCharm terminal?

我正在 Windows 10 尝试在 Python 中编写代码并将变量存储到环境变量中。

当我执行 'set example=123' 时,该命令没有任何我能看到的问题,但是当我自己输入 'set' 以便我可以看到存储的内容时,我得到这个:

PS C:\Users\Abrahim\Desktop\New file> set

cmdlet Set-Variable at command pipeline position 1
Supply values for the following parameters:
Name[0]:
Set-Variable : Cannot bind argument to parameter 'Name' because it is an empty array.
At line:1 char:1
+ set
+ ~~~
    + CategoryInfo          : InvalidData: (:) [Set-Variable], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyArrayNotAllowed,Microsoft.PowerShell.Commands.SetVariableCommand

我不确定这是否相关,但我看到一些地方建议我必须设置环境。如果我只是在那个工作过程中需要它,我是否必须设置它? 在我所在的在线课程中,该人只是直接使用 env 并没有安装或设置任何东西。这就是我要求确认的原因。

为了以防万一 'SET'、'env' 和 'ENV',我尝试了所有大写。

PS C:\Users\Abrahim\Desktop\New file> SET

cmdlet Set-Variable at command pipeline position 1
Supply values for the following parameters:
Name[0]:
Set-Variable : Cannot bind argument to parameter 'Name' because it is an empty array.
At line:1 char:1
+ SET
+ ~~~
    + CategoryInfo          : InvalidData: (:) [Set-Variable], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyArrayNotAllowed,Microsoft.PowerShell.Commands.SetVariableCommand


PS C:\Users\Abrahim\Desktop\New file> env
env : The term 'env' 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
+ env
+ ~~~
    + CategoryInfo          : ObjectNotFound: (env:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


PS C:\Users\Abrahim\Desktop\New file> ENV
ENV : The term 'ENV' 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
+ ENV
+ ~~~
    + CategoryInfo          : ObjectNotFound: (ENV:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

转到 windows 选项卡并键入 CMD,然后在命令提示符中键入 set,然后输入。