Since this has been helpful to many colleagues, I thought I would put together my development setup and especially include a small how-to on setting up PyCharm with remote support.
- SurfaceBook laptop on a stand
- 2 external 24″ monitors
- Kinesis Freestyle2 split keyboard
- wireless mouse
- external webcam
- wireless headset
- SurfaceDock to bring it all together with minimal daily cable management
- PyCharm IDE
- KiTTY ssh client
- Keep for todo lists
- OneNote for note-keeping
- PowerPoint for presentations / running plots
- KeePass password manager
- Dropbox for all documents and presentations (except code, but including the password database so that I can access it on my phone through KeePass2Android)
- Github for anything code-related
PyCharm remote setup
The pros are extremely appealing: You can run everything on a remote server while the development experience feels as if it were local. PyCharm takes care of uploading changes, running the remote interpreter (even in debug mode), and displaying figures directly in the IDE.
Follow these steps to setup PyCharm in the same way:
- open File > Settings, navigate to Project > Python interpreter
- On the right side of the “Python Interpreter” line, click the gear icon and click “Add…”
- select “SSH Interpreter” and create a new server configuration. Enter the host and your username, click next
- Enter your password or private key, click Next
- Enter the path to the remote interpreter. I use a local miniconda installation, so for me the path is something like /braintree/home/user/miniconda3/bin/python.
- On the same screen, click the Folder icon to the right of “Sync folders” and input where you want your local files synced. Click Finish
That’s it! You can now program as usual in your IDE and files will automatically be transferred to the remote host. When you run/debug things, they will automatically run on the remote host.
- Running fig.show() with a matplotlib figure will show it directly in the IDE
- For multiple attached projects, you can go to Settings > Build, Execution, Deployment > Deployment > (in view) Mappings to setup the local/remote path pairs
- Make sure to use the integrated Version Control tools. If they don’t show up automatically, check that the directory is recognized under version control in Settings > Version Control
- Use auto-formatting! PyCharm can automatically reformat your code according to a specific (or default) code style
- Use hotkeys! They make it much quicker to accept suggestions, auto-format, run, step into etc. (I use the Eclipse keymap out of habit)