Powershell ISE 中出现 Python 错误

标签 python powershell powershell-ise

我正在阅读 Zed Shaw 的 Python the Hard Way 一书的第一章,但我已经卡住了。我可以在命令 shell 中运行 python,但是当我尝试在 PowerShell 中运行它时,我得到了这个:

python : Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
At line:1 char:1
+ python
+ ~~~~~~
    + CategoryInfo          : NotSpecified: (Python 3.7.3 (v...ntel)] on win32:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

任何指导表示赞赏。我现在将继续使用命令 shell,但很想弄清楚 PowerShell

最佳答案

您必须运行 Windows PowerShell,而不是 Windows PowerShell ISE

ISE 是 PowerShell 的脚本编辑器,不运行 python。 Windows PowerShell(不是 ISE)允许您运行 python。

关于Powershell ISE 中出现 Python 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55602727/

相关文章:

powershell - 使用批处理脚本删除csv文件的第一行和最后一行

mysql - 如何通过从数据库读取计算机名来检索登录用户?

python - 如何获得多列分组 Pandas 的最大值?

python - 在 UNIX 网络共享上从 Windows 创建硬链接(hard link)/符号链接(symbolic link)

PowerShell 配置文件不安全?

powershell - 使用PowerShell停止进程,我可以绕过确认吗?

powershell - 是否可以在 Powershell ISE 中重置运行空间?

sql - Powershell:将文件路径指定为变量

python - Django 查询集 : how to get items after a particular id in the queryset

python - 在 Python 中打开一个 .txt 文件