On Fri, Sep 19, 2008 at 10:20 AM, tcp <[EMAIL PROTECTED]> wrote: > > Hi, > > New to Python...getting started with Django. > > I've just installed Django and and following some getting started > instructions. > > I'm trying to run django-admin like this: > > c:\myproject> python django-admin.py startproject iFriends > > and I get this problem: > > python: can't open file 'django-admin.py': [Errno 2] No such file or > directory > > This shouldn't be surprising as django-admin.py is not in the current > working directory. The file is in C:\python\Django-1.0\django\bin. > > I DO have C:\python\Django-1.0\django\bin on the PYTHONPATH. Here is > proof: > > >>> import sys > >>> print sys.path > ['', 'c:\\python\\Django-1.0\\django\\bin', 'C:\\Windows\\system32\ > \python25.zip > ', 'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat- > win', 'C: > \\Python25\\lib\\lib-tk', 'C:\\Python25', 'C:\\Python25\\lib\\site- > packages'] > > So, why is python not finding the file that is on the PYTHONPATH. I > thought the PYTHONPATH was similar to a Java CLASSPATH? Do I > misunderstand? >
PYTHONPATH is used for imports. For locating the initial .py file to start running, it has to be in your Windows PATH, just like any other executable. Also I think you need to drop the 'python' from the front of the command so that the Windows path search will actually happen. I believe python.exe will just try to open whatever is specified in its first argument, and not search the Windows PATH. If you drop the python from the beginning then Windows will take care of searching PATH for the file, and then invoke python.exe to run the command (since the Python install has set up an association from the .py extension to the python.exe executable). Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---