Define remote interpreter on remote Linux machine using Pydev and RSE Server

后端 未结 4 394
忘了有多久
忘了有多久 2020-12-10 02:25

I have a Windows box and a Linux red hat box.

Eclipse is installed on Windows, following instructions given on this eclipse page. I managed to set up a RSE server th

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 02:38

    I managed to achieve this by doing the following:

    1) Create a python venv

    python3 -m venv /home/me/venv
    

    2) Set pydev interpreter to the venv by going to Window->Preferences->PyDev_Interpreters->Python Interpreter-> Browse for python/pypy

    3) Backup the python executable if needed:

    mv /home/me/venv/bin/python3 /home/me/venv/bin/python3.bkp
    

    4) Create a new python executable with the same name:

    nano /home/me/venv/bin/python3
    

    5) Paste the following content:

    #!/bin/bash
    
    remote_username=me
    remote_interpreter=python3
    remote_hostname=10.0.0.1
    
    file_path=(${2//$remote_hostname/ })
    
    ssh $remote_username@$remote_hostname "$remote_interpreter $1 ${file_path[1]}"
    

    6) Change remote_username, remote_interpreter and remote_hostname to match your configurations.

    Enjoy !

提交回复
热议问题