- Clone project to local:
git clone <project URL>
- Create project root on remote:
ssh <server> mkdir -p <remote project path>
- Create project root and environment on remote
- Copy
environment.yml
to remotecd <local project root> scp environment.yml <server>:<remote project path>
- Create environment on remote
ssh <server> cd <remote project path> conda create -p ./env -y conda activate ./env conda env update -f environment.yml
- Copy
- Open PyCharm, and open the local project folder (File -> Open)
- Add Python interpreter
- Open Settings (File -> Settings...)
- Click Project: -> Python Interpreter
- Click gear icon next to -> Add
- Click SSH Interpreter
- Create new server configuration to remote, then Next
- Set Interpreter as the remote path to the interpreter (e.g., /env/bin/python)
- Set sync folders between the local and remote project roots (i.e.,
<local project path>
-><remote project path>
) - Click "Finish" at the bottom
- Click "Overwrite" in the "Directory Exists" window that pops up
- Click "OK" at the bottom
- Edit deployment configuration
- Open Deployment Configuration (Tools -> Deployment -> Configuration...)
3. Rename the default deployment configuration to the project name
4. Under the "Connection" tab, set the root path to the remote project path
5. Under the "Mappings" tab
1. Set the local path to the local project path
2. Set the deployment path to "/"
6. Click "OK" at the bottom
- Update Python run template
- Click "Add Configuration" in top right
- Click Templates -> Python
- Add
DISPLAY
environment variable:DISPLAY=localhost:10.0
- Set Python interpreter to the project default
- Click "OK" at the bottom