Karen and Rodolfo,

Thank you both for your quick answers. I have associated .py files
with Python.exe and then started Python by invoking the specific .py
file rather than directly invoking Python.exe and it works fine. Here
is the proof:

C:\>django-admin.py
Type 'django-admin.py help' for usage.

C:\>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\java
\jdk1.6.0_07\bin;
c:\python25;C:\Program Files\PuTTY;C:\python\Django-1.0\django\bin

Now I understand better that PYTHONPATH is only used for import and
not to load the initial module. Thanks.
Tom

On Sep 19, 10:49 am, tcp <[EMAIL PROTECTED]> wrote:
> Ok. Now the link to the PATH makes more sense to me. I will try again
> by associating .py files to Python.exe.  Tom
>
> On Sep 19, 10:45 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
>
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to