繁体   English   中英

Pycharm 无法远程运行 python 解释器错误

[英]Pycharm Can't run remote python interpreter error

我有一个 aws ec2 实例,我想通过 pycharm 访问和工作,但我无法正确配置对远程终端的访问。 我做的步骤是:

  1. using github and pycharm I clone the project repository and at the start of the program, since there is no configured python interpreter I start the configuration by clicking on the button "configure python interpreter"

在此处输入图像描述

  1. 然后 select ssh 解释器并输入 aws 实例的 ip 地址和用户名 Z1D41C8990AF58D3ADDAEZ444441778Z4

在此处输入图像描述 3) 作为密钥,我选择以前保存的 ppk 文件

在此处输入图像描述

4)继续设置 I select 解释器,如路径 usr/bin/python 中标识的解释器和项目目录 I select 我的项目目录在 home/ubuntu/MyProject

在此处输入图像描述

这是我设置远程解释器后看到的

在此处输入图像描述

所有连接测试均已成功通过,但是当我运行代码时出现此错误

Error running 'main': Can't run remote python interpreter: Error connecting to remote host

在此处输入图像描述

那么我该如何解决这个问题呢?

最后我找到了一个解决方案,默认情况下 pycharm 为解释器设置路径 usr/bin/python 但正确的是 usr/bin/python3,现在一切正常

我有同样的错误,但原因不同:运行配置中的 docker 卷绑定之一指向不存在的主机目录

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM