无法运行程序 (python) 没有那个文件或目录

che*_*sus 9 python pycharm

我在学校得到了一个代码来调制一个研究项目,但首先我想按原样运行它,未调制。它是用 Python 编写的,我在 Ubuntu 18.04 和 Python 2.7 上使用 Pycharm CE ......我在项目设置中选择了正确的解释器(我认为。路径是 /usr/bin/python2.7),我得到了这个错误信息:

运行“项目”时出错:无法运行程序“C:/WinPython-64bit-2.7.9.1/python-2.7.9.amd64/python.exe”(在目录“/home/user/Documents/model”中):错误= 2、没有那个文件或目录

为什么 Pycharm 仍然在我假设之前的用户曾经放置的文件夹中寻找解释器?

gca*_*rgo 6

您可以通过修改.idea/workspace.xml文件来修复此错误。搜索并删除所有旧的口译员并放置正确的口译员。

受 Ryan Elfman 帖子启发的答案:https : //intellij-support.jetbrains.com/hc/en-us/community/posts/206597295-Why-can-tI-run-a-script-in-PyCharm-when-I -can-debug-it-I-get-CreateProcess-error-123

  • 我通过删除“.idea”文件夹解决了这个问题。 (2认同)