On Aug 26, 2009, at 12:55 PM, ctalley 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 > > I get this error => python: can't open file 'web2py.py': [Errno 2] No > such file or directory > > I've added the web2py.py path to the Windows PATH system variable and > verified using echo %PATH% from the command prompt. > > I've created and added the web2py.py path to the Windows PYTHONPATH > system variable and verified using echo %PYTHONPATH% from the command > prompt. > > I've added the web2py.py path to sys.path using sys.path.append and > verified using print sys.path > > I can run python from the command prompt from any directory. > > I can run web2py.py from the command prompt from any directory. > > Obviously there's some kind of path problem, but I can't figure out > what. Anybody ever see this?
PYTHONPATH and sys.path are module search paths, not executable search paths, and the system shell (not python) looks at PATH. When you say "python web2py.py", python looks for web2py.py in the current working directory only. You can give it a full path: python c:...web2py.py if you really need to run it from another directory. (I should qualify this by saying that this is the way it works on Unix, and I'm assuming that it works that way on Windows.) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

