... | ... | @@ -24,7 +24,7 @@ The first step consists in creating a PyCharm Python project on your local machi |
|
|
- Select `Project: <project-name>/Python Interpreter`, then click on the wheel icon and select `Add`.
|
|
|
- On the left, select `SSH Interpreter`, then create a new server configuration (if you don't have one already), specifying the hostname of the server (see ["Servers Information"](/servers)) and your username.
|
|
|
|
|
|
The figure below shows an example for hostname `icaro.polito.it` and username `YOUR_ID`:
|
|
|
Figure 1 below shows an example for hostname `icaro.polito.it` and username `YOUR_ID`:
|
|
|
|
|
|
<img src="./figures/pycharm1.png" width="500">
|
|
|
|
... | ... | @@ -32,13 +32,13 @@ Then, insert your authentication details to connect to the target server in the |
|
|
|
|
|
#### Set the Path of the Remote Python Executable
|
|
|
|
|
|
In the following dialog, you can select the path of the Python executable that you want to use in the remote server. You can do so by clicking on the folder icon highlighted in the top right of following figure.
|
|
|
In the following dialog, you can select the path of the Python executable that you want to use in the remote server. You can do so by clicking on the folder icon highlighted in the top right of Figure 2 below:
|
|
|
|
|
|
<img src="./figures/pycharm2.png" width="500">
|
|
|
|
|
|
You can either set this path to the system-wide installation of your preferred Python version, or (more commonly) to a project-level virtualenv (see ["Python Virtual Environments"](/virtualenv)).
|
|
|
|
|
|
As shown in the following figure, PyCharm will let you navigate graphically the directories of the server and select your preferred Python path. For virtualenvs, the executable path is `<virtualenv-root>/bin/python`.
|
|
|
As shown in Figure 3 below, PyCharm will let you navigate graphically the directories of the server and select your preferred Python path. For virtualenvs, the executable path is `<virtualenv-root>/bin/python`.
|
|
|
|
|
|
<img src="./figures/pycharm3.png" width="300">
|
|
|
|
... | ... | @@ -48,7 +48,7 @@ The figure shows an example for a virtualenv located in the user's home director |
|
|
|
|
|
#### Setup Automatic Synchronization of Project Files
|
|
|
|
|
|
Lastly, you have to setup the automatic synchronization of Python files from your local machine to the remote server. In the window shown in the second figure above, select the option: "Automatically upload project files to the server". Then click on the folder icon at the right of "Sync Folders" and change the "Remote Path" to the location where you want your project files to reside on the server.
|
|
|
Lastly, you have to setup the automatic synchronization of Python files from your local machine to the remote server. In the window shown in Figure 2 above, select the option: "Automatically upload project files to the server". Then click on the folder icon at the right of "Sync Folders" and change the "Remote Path" to the location where you want your project files to reside on the server.
|
|
|
|
|
|
The figure below shows an example where a local project found in `~/Documents/code/my_project` is synchronized with the remote folder `/space/<username>/my_project`.
|
|
|
|
... | ... | @@ -57,3 +57,11 @@ The figure below shows an example where a local project found in `~/Documents/co |
|
|
|
|
|
**IMPORTANT:** the Python virtualenv does *not* need to be in the same folder as your project. In fact, in many cases it could be better to have them in separate folders, for the reasons explained below. For instance, on `icaro.polito.it`, it may be convenient to have your virtualenv in `/home` and your project in `/space`
|
|
|
|
|
|
Lastly, click "Finish" on the dialog shown in Figure 2 to complete the setup of your remote interpreter.
|
|
|
|
|
|
#### Accessing Remote Files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|