【问题标题】:python not running in powershell ISE [duplicate]python没有在powershell ISE中运行[重复]
【发布时间】:2022-01-01 02:06:50
【问题描述】:

当我在 Windows powershell 或命令模块 (Windows 10) 中键入“python”时,我进入了 python 环境。但是,当我在 Windows Powershell ISE 中尝试相同的操作时,我收到如下错误消息。关于如何做的任何指导?

python : Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
At line:1 char:1
+ python
+ ~~~~~~
    + CategoryInfo          : NotSpecified: (Python 3.9.0 (t...MD64)] on win32:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Type "help", "copyright", "credits" or "license" for more information.

【问题讨论】:

  • 你可以试试python3
  • ISE 不支持交互式控制台应用程序。尝试在其中输入powershell.exe,您应该会收到一条错误消息,表明它不受支持;其他交互式控制台应用程序也存在同样的问题,只是它不是$psUnsupportedConsoleApplications您可以在 ISE 控制台中键入)列表的一部分。建议使用 VSC 以备将来使用。

标签: powershell powershell-ise


【解决方案1】:

您不能从 Powershell ISE 以交互方式运行 python。不仅是 python,您将无法运行任何交互式控制台应用程序。

要使用python,你需要使用start python,它会在新窗口中打开python cmdline。

【讨论】:

    猜你喜欢
    • 2018-08-13
    • 1970-01-01
    • 1970-01-01
    • 2020-09-09
    • 2013-03-15
    • 1970-01-01
    • 1970-01-01
    • 2011-11-12
    • 1970-01-01
    相关资源
    最近更新 更多