I'm trying to configure remote debugging in pycharm on vagrant, but when I run I get the following error:
ssh://[email protected]:2222/usr/local/strongarm_venv/bin/python2.7 -u /home/vagrant/.pycharm_helpers/pydev/pydevd.py --multiproc --client '0.0.0.0' --port 49921 --file /vagrant/manage.py runserver 8000
/usr/local/strongarm_venv/bin/python2.7: can't open file '/home/vagrant/.pycharm_helpers/pydev/pydevd.py': [Errno 2] No such file or directory
I've searched the internet and my entire drive for a directory called ".pycharm_helpers" but all I can find is that pycharm was supposed to have created it at some point on the VM, which it hasn't done. Where can iI find a copy of it to manually insert, or how do I tell pycharm to put it there?
If you go to the Default Settings under Default Project > Project Interpreter, and make sure your Vagrant VM's python is selected as the Project Interpreter.
If it is not shown as the current selection, drop down the list of interpreters and select it.
Most likely, if it is not appearing as the selected interpreter, the vagrant machine does not match the configuration when you first connected the interpreter to the machine, in which case the PyCharm will try to fix it.
If it fails to fix it, remove the interpreter and add it back again.
If the other variations here didn't work for you, you might want to delete the .pycharm_helpers
folder from the VM. Open a SSH session to your Vagrant machine:
Tools > Start SSH Session... > Vagrant at \your\path\to\vagrant
Run the following:
-rf /home/vagrant/.pycharm_helpers/
This will delete the PyCharm helpers. Next you'd like to get them reinstalled.
File > Settings > Project: primary > Project Interpreter
Change the Project Interpreter
to your default interpreter. Click Apply
, then back to the vagrant VM, and click Apply
again.
This should make .pycharm_helpers
download again.
I had the same problem after updating project's vagrant box. So, the easiest way to fix it is to remove Project Interpreter in the Settings and then to add it again. After that you'll see that PyCharm updates its helpers for new interpreter.
Pycharm is supossed to have uploaded these files to the vagrant VM when loading the remote interpreter. Something may be wrong with your connection to the vagrant machine, are you able to connect via ssh from pycharm to the VM?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With