PyCharm

The following tutorial is based on Windows 10, 2019.3.3 (Professional Edition)

Caution

Please note that remote connection feature only supported at PyCharm Professional!

Install PyCharm

Download PyCharm according to your operating system from jetbrains.com/pycharm

../_images/install.png

SSH key

Open your lab and make sure the ssh key is generated. Click the ssh key to download to your PC.

../_images/sshkey.png

SSH Config, download SSH key by clicking the ssh key link

Tip

downloading will start automatically, if it does not press the ssh key link.

Note

In Linux, you need to change the sshkey file to 600 mode.

PyCharm Project

Open the PyCharm and create a new project.

../_images/pycharm_open.png

Create a new SSH Interpreter from Pure Python -> Existing interpreter ->

../_images/pure_python.png

Setup Remote Interpreter

Type in the SSH host IP, port and user information in SSH Interpreter section. (Fill in the information based on SSH Config above)

../_images/ssh_interpreter.png

Click Next and PyCharm will try to connect to the Lab, click Yes to continue.

../_images/connect.png

PyCharm will ask you for authentication, select the downloaded SSH Key at Key pair -> Private key file.

../_images/private_key.png

Once PyCharm successfully connect to the lab, you can set the interpreter path /usr/bin/python3. Then, click Finish to complete the interpreter setup.

../_images/python_interpreter.png

Now the remote interpreter is added, click the Create button to open the project page.

../_images/create.png

Tip

You can select the remote project location at this page or later.

Project Files Synchronize

In PyCharm, all the file editions happen in you PC. We have to download lab files to your PC first. Click Tools -> Deployment -> Configuration to select remote folder.

../_images/configuration.png

Select remote folder by clicking remote host -> Mappings -> Deployment path.

../_images/deployment.png

Choose the remote path /mlsteam/lab and click OK.

../_images/deployment_path.png

Now we can download the remote /mlsteam/lab folder to your PC.

First, select your project folder, in this case is untitled at left column of PyCharm. Then, click Tools -> Deployment -> Download from -> remote host.

../_images/download_file.png

The download should proceed and you will see the following messages if the lab has many files.

../_images/download_log.png

You can browse and edit the loaded files in left column of PyCharm. Any modification in the files will be synchronized to remote folder automatically.

Note

If you want to synchronize(upload) local PC files to remote manually by clicking Tools -> Deployment -> Sync with Deployed to …