簡體   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