PyCharm Python Project No such file or directory.

When I try to start a project in PyCharm, I get the following error. I installed the virtual box, the tramp and all the requirements in the readme file that they gave me, but when I clicked the run ...

ssh:// vagrant@127.0.0.1 :2222/usr/bin/python -u /Users/gtas/Projects/PythonProj/manage.py runserver 0.0.0.0:8000 bash: line 0: cd: /Users/gtas/Projects/PythonProj: No such file or directory /usr/bin/python: can't open file '/Users/gtas/Projects/PythonProj/manage.py': [Errno 2] No such file or directory Process finished with exit code 2 

[EDIT] Looks like the VM firewall mappings are not properly configured / installed.

Any ideas why this is driving me crazy?

I am using Mac OS X 10.9.2 and the latest PyCharm development environment.

Thanks in advance.

+6
source share
6 answers

I started to have the same problem after upgrading to PyCharm 3.4 - before that everything worked fine, and after upgrading - the same error. Also fixed by updating path mappings: go to "Run / debug configurations" and manually define path mappings. The local path should be the outline of your Django project and the remote path to the project path in the roaming virtual machine.

+12
source

Another way to add the root of the project context in the settings.

 Preferences -> Project Structure -> Add Context Root 

enter image description here

+2
source

I get this problem whenever I move the project folder. I found that the problem is that the mapped folder on the virtual machine is no longer available; ls shows the following:

(vagrant) vagrant@ralph-dev :~/src$ ll ls: cannot access ralph: No such file or directory total 8 drwxr-xr-x 3 root root 4096 Jan 11 07:42 ./ drwxr-xr-x 15 vagrant vagrant 4096 Mar 7 09:45 ../ d????????? ? ? ? ? ? ralph/

The solution has the form of a vagrant reload . After that, the moved folder is displayed correctly.

+1
source

This problem usually occurs when u updates the python version and removes the old python directory.

Perhaps you can solve the problem by creating a new project with pycharm and copying all the files in the hiding directory named ".idea" in the new project directory to the old projects directory "/.idea" and select replace.

Hope this helps and forgive my poor English

+1
source

Since you mention that your installation includes a virtual box and a stroller, you may need to update the path mappings in your Vagrantfile. In my case, adding synchronized paths between the host and the stroller, e.g.

 config.vm.synced_folder "../code_folder", "/home/vagrant/code_folder" 

then a vagrant reload and restart Pycharm solved the problem.

0
source

I solved the problem by simply deleting the .idea folder. You can try it like that.

0
source

All Articles