I use PyCharm Professional with Vagrant support.
Editing my files works fine. My files are on my local machined and "mapped/mounted" into the Vagrant machine.
But if I go to the declaration of a file which is outside the mapped directory, PyCharm opens a cached version. For example the django source code is outside the mapped directory:
/home/guettli/.cache
is on my local machine, not inside Vagrant.
If I edit this (for example I add assert 0, value_which_i_want_to_see
), then this change is not active, since the original file did not change.
How to edit the files with PyCharm which are outside the Vagrant mapped directory?
Your pycharm
and Vagrant
directory should be one and the same, meaning your project directory, like:
Both of them use caching, but you shouldn't care about those. Basically (in this case projects
is just a convention, can be any path you want and usually use): /home/<userid>/projects/<your-project>
, inside of which you have your src
for your python
code and Vagrantfile
for your Vagrant machine definition. Then, to access your python code inside your VM, spawn up by Vagrant
using probably VirtualBox as a Hypervisor, you may mount
your desired directory in your desired path.
So in this case, the files you have part of your PyCharm project (i.e. editor view) are the same files within your parent /home/<userid>/projects/<your-project>
and executed by your process inside the VM managed by Vagrant.