python.exe: Resolve "command not found"

Recently when I was working on hosting Django site in Windows 7 machine I came up through the following error (python command not found)

$ c:\Python27\python.exe django-admin.py startproject myproject .
sh.exe": c:Python27python.exe: command not found


Frist I discovered it is because of not having back -slash  and I added (\\)

 $ c:\\Python27\\python.exe django-admin.py startproject myproject .
c:\Python27\python.exe: can't open file 'django-admin.py': [Errno 2] No such fil
e or directory

In this way you can invoke phthon.exe without adding it to environmental variables by giving absolute location. (c:\Python27\python.exe) However another error still persisting "can't open file 'django-admin.py': [Errno 2] No such fil
e or directory".


Since django is located in the site packages it also required to give the absolute parth. In my case it is
"C:\\Python27\\Lib\\site-packages\\django\\bin\\django-admin.py"


So that below will be work fine and you can come up with expected outcome.

$ c:\\Python27\\python.exe C:\\Python27\\Lib\\site-packages\\django\\bin\\djang
o-admin.py startproject myproject.

Comments

Popular posts from this blog

ENOENT: no such file or directory, rename : node_modules/async

react-quill Integrate quill-image-resize-module