来自 CLion 的 运行 Python 给出 "Processed finished with exit code 127"

Running Python from CLion gives "Processed finished with exit code 127"

我正在 Ubuntu 中尝试 运行 Python 来自 CLion 2016.3 的脚本,但它以

退出
Process finished with exit code 127

立即,过一会儿(可能是 30 秒)我得到

Couldn't connect to console process.

在下面。根据控制台是 运行 的命令是

/usr/bin/python3 /home/martint/.tools/ide/clion/plugins/python/helpers/pydev/pydev_run_in_console.py 38205 37065 [path_to_script].py

我也无法让 IDE 识别我的环境,即所有导入都带有红色下划线。我想这有关系?我能够从命令行 运行 执行完全相同的命令,并且有效。有什么想法吗?

我有同样的问题。就我而言,禁用 以下 Run/Debug 配置中的选项有帮助:

  • 将内容根添加到 PYTHONPATH
  • 将源代码添加到 PYTHONPATH