PyCharm on Windows to develop on Ubuntu server in local VM?

Developing on Windows but really want to get away from developing on Windows...if that makes any sense.  I do have to stay in Windows due to other engineering software we have that will only run on this platform.

I am using PyCharm to develop apps to deploy on Linode/Ubuntu.

I am interested in learning if there's a way for me to setup Ubuntu Server on a local VM for development purposes while PyCharm runs under Windows.  The alternative would be to run PyCharm under Ubuntu Workstation running on a local VM.  The latter would completely unplug me from Windows for Python/Django development (which is what I want) at the cost of some complexity.  The former would allow me to simply have the app run under Linux while the IDE runs under Windows.  I can easily setup a shared drive between the Ubuntu Server VM and Windows for development purposes.

Is this possible?  If so, is there documentation on how to go about setting it up?

Thanks!
4 comments
Comment actions Permalink
PyCharm 4 (EAP) has integration with Vagrant (you can of course use Vagrant by itself too).  Vagrant maps your project directory to /vagrant on the guest, so you can continue using PyCharm and then create symlinks on your guest to where you need the files to end up.
0
Comment actions Permalink
I just followed this:

https://www.jetbrains.com/pycharm/quickstart/configuring_for_vm.html

I succeeded in running a virtual machine via Vagrant from within PyCharm.  What isn't clear beyond this point is how to use virtualenv to actually run the project in a virtual environment within the Ubuntu VM.  It doesn't look like I can set this up through the usual "Project Interpreter" in Settings.  All I can choose is to use "/usr/bin/python" in the VM.  Any thoughts on how to switch to a virtualenv?

Thanks!
0
Comment actions Permalink
My use is limited to very simple tool calls from PyCharm, otherwise I use the commandline in linux.  The tool calls are all of the form:

    vagrant ssh -c "touch /vagrant/www/foosite/wsgi.py"

you can probably do many more fancy things, but realistically – if you really want to be a linux developer you should just install ubuntu desktop (and use windows in a vm if you can't live without it).
0
Comment actions Permalink
We can't run Windows on a VM under Linux for various reasons.  We do mechanical and electronic design here as well.  The software tools that we use for these tasks are very power-hungry.  They don't run very well in a virtualized environment at all.  A simple case of this is the electronics design package requiring three monitors.  Tools like Solidworks should be run on the host machine.

You are right in that we can run exactly what we need directly from a putty terminal window by hand.  I am simply trying to see if there's a better way to integrate PyCharm into this workflow through the use of the remote interpreter capability.  I have it working now, but can't figure out how to switch it to a virtualenv on the VM.  One VM could host a number of projects, so using virtualhost is critical.  If we did not we would have a mess of modules loaded on top of the existing Ubuntu Python installation.  The simple act of switching back and forth between Python 2.7.x and 3.x for different projects alone would make a mess out of the system.  Ubuntu itself makes use it's Python installation, making modifications isn't advisable.

I should add that it would be trivial to simply run PyCharm within an Ubuntu Workstation VM and do all development in that environment.  That would work.  However, one of the reasons we purchased PyCharm Professional Edidtion is that it is supposed to be able to use a remote interpreter and do remote debugging.  We are simply trying to get this to work with a virtualenv on the remote.

Perhaps someone from JetBrains can pitch in here?  It seems like a last small step:  Once you have a Vagrant remote interpreter working, how do you configure for a virtualenv in the VM?

Thanks!
0

Please sign in to leave a comment.