【问题标题】:Can't open python.exe in Windows Powershell无法在 Windows Powershell 中打开 python.exe
【发布时间】:2013-04-13 00:37:44
【问题描述】:

前段时间我从 Windows 中删除了我的 python 程序,最近从主站点下载了 python2.7.4,但是当我从 C: 的 Windows PowerShell(x86) 提示符中键入“python”时,我得到了消息“'python' 未被识别为内部或外部命令、可运行程序或批处理文件。”,我想了解如何解决此问题。

当我在实际的 python27 文件夹中时,我得到了相同的消息(python.exe 确实在那里)。但是,当我输入.\python 时,它会按预期运行,而我的计算机可以运行其他.exe 就好了。我在 Sony VAIO 笔记本电脑上使用 Windows 7 Home Premium Service Pack 1。我对我电脑的内部运作不是很熟悉,所以我不知道从哪里看。

我当前的路径是这样的,python 文件夹在最后:

%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Java\jdk1.6.0_23\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.42;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\apache-ant-1.8.4\bin;C:\Program Files\TortoiseSVN\bin;C:\Windows\system32\WindowsPowerShell\v1.0\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Java\jdk1.6.0_23\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.42;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\apache-ant-1.8.4\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_23\bin;C:\Python27

【问题讨论】:

  • 一些“愚蠢”的建议 - 在路径末尾添加 ;,然后注销并重新登录。
  • 有效!感谢您的快速回复。

标签: python windows powershell path exe


【解决方案1】:

让 cmets 成为未来参考的答案:

在路径末尾有一个;,然后注销并重新登录。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-06
    • 1970-01-01
    相关资源
    最近更新 更多