On Wed, Aug 26, 2009 at 2:55 PM, ctalley<[email protected]> wrote:
>
> This is probably off topic, but here goes...
>
> I can't run "python web2py.py --upgrade yes" from any directory except
> the directory containing web2py.py

That's correct.

>
> I get this error => python: can't open file 'web2py.py': [Errno 2] No
> such file or directory

That's correct.

>
> I've added the web2py.py path to the Windows PATH system variable and
> verified using echo %PATH% from the command prompt.

This is not relevant, as "web2py.py" is not the command; it is the
parameter to the executable, python (which needs to be in your path,
or have the full path specified to it) - on windows, windows knows
that *.exe are one kind of executable file, so it is really running
this for you:

python.exe web2py.py ....

>
> I've created and added the web2py.py path to the Windows PYTHONPATH
> system variable and verified using echo %PYTHONPATH% from the command
> prompt.

This is where the python interpreter will look for libraries, e.g.
import statements...

If you say:

import foobar

and foobar isn't in current directory, then python will search the PYTHONPATH

>
> I've added the web2py.py path to sys.path using sys.path.append and
> verified using print sys.path

Again - this would have an effect if you wrote a script that did
"import web2py" - but since web2py isn't a module (rather an
application) this is of little use.

>
> I can run python from the command prompt from any directory.

That means you have it in your windows PATH environment.

>
> I can run web2py.py from the command prompt from any directory.
>

What this means is that you have assiciated *.py in wondows as a kind
of executable to be run by python.exe (which is ok);  this only works
from any directory because you have added web2py.py to your windows
path.

> Obviously there's some kind of path problem, but I can't figure out
> what.  Anybody ever see this?

There is no problem - everything is working exactly as expected.

If you want to pass web2py.py as a parameter to python.exe from
anywhere, you need to tell python where to find the web2py.py file to
open it.

For example, if you set a windows environment variable such as:

WEB2PY_PATH

then

python %WEB2PY_PATH/web2py.py

would work as you are expecting.

BTW - this is not specific to windows - the same is true, for example,
on Linux, for each item I've pointed out.

Regards,
- Yarko

> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to