Next, configure the “Remote Python Interpreter”. This can be done under “Code Style” in P圜harm Settings. The first setting to change is the “Line Seperator” (unless you want to execute Dos2Unix each time you run the file on Linux). Now every modification of my Python files in my “K:\MyProject”, is exactly the same on the Linux virtual-box. (I have also added my user-id to the “vboxsf” group because of permissions. See image below for illustration.Īt this time, My “c:\projects” folder is shared to the Linux environment as “/media/sf_K_DRIVE/” and “auto-mounted”. If you have a remote host, then either setup a GIT push scheme or a SFTP from your Windows to this remote server. Shared a “Machine Folder” to my Virtual machine. Share my c:\projects\MyProject to myself so that I can map a new drive under Windows such as “K:\MyProjects”.
To avoid this issue, here’s the solution I have engaged. When you run the interpreter, you will run into issues such as “No such file or directory.” That’s because when you execute a file natively in Windows under c:\temp\abc.py - the “remote interpreter” is now looking for a file under that same path in the remote server under Linux. This will simplify your footprint on the server side. (Please note that this feature can then lend itself to running the Linux server as a terminal without a GUI/Windows Manager like KDE/Gnome).
Furthermore, you can perform step-through of your code right from your development platform as if you ran the IDE right within the Linux machine.
This feature allows you to connect with a Python environment and all’s of it’s SITE_PACKAGES available on the remote machine as if you were running it locally on your native PC. Now that we have a good idea about my development environment, let’s go over why I want to use the “remote interpreters” feature.
This Linux could also be running in a separate physical host accessible via TCP-IP. And so my P圜harm IDE runs on Windows and I have a VirtualBox instance of CentOS linux running within my host machine accessible via a Virtual Box - Bridged Adapter.
I develop software for a Linux based system and most of the Python libraries that I need to work from third-party vendors are only available for Linux. I have a Windows 7 host where I do most of my development. Let’s get right into the issue: My Setup: You can read more about the new exciting features here.īut as I started to tinker with the “remote interpreter” feature - I stumbled upon some challenges and I thought I’d document them for other P圜harm users who might benefit from this blog entry. If you are an avid Python developer, you may all be excited about the new features available in the Pycharm 2.5 release, especially the remote interpreters, virtualenv and setup.py support.