cluster:usage_tips:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cluster:usage_tips:python [2022/05/16 22:48] aegircluster:usage_tips:python [2022/05/16 23:04] (current) aegir
Line 50: Line 50:
 ==== Step 6: Configure a remote interpreter ==== ==== Step 6: Configure a remote interpreter ====
 Once the project is open we need to configure a python interpreter to use as a remote execution Once the project is open we need to configure a python interpreter to use as a remote execution
-environment. Navigate to ''file -> settings -> project -> python interpreter''. Press the wheel icon in the corner that is seen circled in red in the image below and select the ''add...''option+environment. Navigate to ''file -> settings -> project -> python interpreter''. Press the wheel icon in the corner that is seen circled in red in the image below and select the ''add...'' option
  
-{{ :cluster:usage_tips:add_remote_interpreter.png?600 |}}+{{ :cluster:usage_tips:add_remote_interpreter.png?600 | file -> settings -> project -> python interpreter}}
  
 Once the window is open we select the SSH interpreter option on the left, then fill in Once the window is open we select the SSH interpreter option on the left, then fill in
-the IP address of the server and our username on the remote machine. Finally, we press next. The next image illustrates the process.+the IP address of the server and our username on the remote machine. Finally, we press next. The image below illustrates the process. 
 + 
 +{{ :cluster:usage_tips:ssh_configuration_1.png?600 | fill in the required information 1}} 
 + 
 +Once you are on the next tab, enter your server user's authentication password and press next. See the below image. 
 + 
 +{{ :cluster:usage_tips:ssh_configuration_2.png?600 | fill in the required information 2}} 
 + 
 +On the next tab, change the interpreter to ''/usr/bin/python3''. Then change the sync folder to 
 +the folder you created in step 4. The path should be ''/home/<username>/sleepy_project_files'' 
 +unless you created the directory not in your home directory on the remote machine. Then press 
 +Ok and Finish. The below image illustrates the process. 
 + 
 +{{ :cluster:usage_tips:remote_paths.png?600 | Change to python3 and set working directory}} 
 + 
 + 
 +==== Step 7: Configure remote terminal ==== 
 +For some things such as executing tests in the terminal or browsing project files on the remote 
 +machine you might want to have the remote terminal handy in your PyCharm editor. 
 + 
 +Navigate to ''file -> settings -> SSH terminal''. From there in the SSH interpreter drop-down, select the remote connection you created earlier, e.g ''username@ip_address''. Then click apply before closing the tab if the option to do so is available. See the below image. 
 + 
 +{{ :cluster:usage_tips:ssh_terminal.png?600 |}} 
 + 
 +Once this is done, you need to start the SSH session to get the terminal running. To do this, 
 +click ''tools -> Start SSH session'' in the editors top toolbar. If you open a new tab in the 
 +editor’s terminal you should see that you are no longer in your machines terminal but in the 
 +server terminal. 
 + 
 + 
 + 
 +==== Manually syncing project files ==== 
 + 
 +When we are working on a remote development environment the files are continuously uploaded to the remote server. This is done automatically by PyCharm by default. Sometimes, especially when we are restructuring our files and folders, PyCharm may get confused about what changes must be uploaded and thus corrupting the sync between your local environment and your remote 
 +environment. 
 + 
 +In such cases we can manually trigger a re-upload of our files to the remote server. See the image below for how to do this. 
 + 
 +{{ :cluster:usage_tips:sync_files.png?600 |}} 
  
-{{ :cluster:usage_tips:ssh_configuration_1.png?600 |}} 
  
  • cluster/usage_tips/python.1652741284.txt.gz
  • Last modified: 2022/05/16 22:48
  • by aegir