早些时候,我使用 Chocolatey 安装了 Python 3.5,但是当我发现我只需要使用的库只允许用于 Python 版本 2 时 - 我卸载了 Python 3.5,然后从控制面板安装 Python 2.7.3。
我确保我为 Python 正确设置了 PATH 变量 -
PATH=....;C:\Python27
Run Code Online (Sandbox Code Playgroud)
但是当我从提示中调用 python 时,我仍然收到以下错误:
C:\>python
Cannot find file at '..\\lib\python3\tools\python.exe'
(C:\ProgramData\chocolatey\lib\python3\tools\python.exe). This usually
indicates a missing or moved file.
Run Code Online (Sandbox Code Playgroud)
如何解决巧克力包管理器问题?
choclatey uninstall python在控制面板中的其他 python 版本中运行和卸载后,我遇到了同样的问题。我能够通过从巧克力 bin 目录 (C:\ProgramData\Chocolatey\bin) 中删除 python.exe 和 pythonw.exe 来解决它。
del C:\ProgramData\Chocolatey\bin\pytho*.exe
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!