Thanks a lot! Would like to clearify how i should run python from command line:
1) cmd #in command line shell under windows cd c:/first/Pyhton26 #change to directory with pyhton executable python # to start python environment in comman line shell >>>>import sys >>>>sys.path >>>>#prints C:\first\Python26\Lib\site-packages as one of paths >>>>django-admin.py syncdb # ERROR - name >>>>'django' is not defined OR 2) cmd #in command line shell under windows cd c:/first/Pyhton26 #change to directory with pyhton executable pyhton django-admin.py syncdb #also ERROR: 'can not open file django-admin.py' pyhton django-admin syncdb #also ERROR: 'can not open file django-admin' django-admin.py syncdb #also ERROR: 'no module named django.core' django-admin syncdb #also ERROR: 'django-admin is not recogmized as internal or external command' The idea is that both "python executable" and "django/bin/ with django-admin.py" are in system path. Should i put only pyhton on systme path? 3) I have several different pyhton installations. How cmd can recognize python command if they all are under system path? Does it first look in current working directory: I.e. if i start from c:/fisrt/python26 it will not run python from c:/second/python31? On Aug 25, 12:49 pm, Sam Lai <samuel....@gmail.com> wrote: > If you want to understand why you are getting the error, start by > understanding Python modules -http://docs.python.org/tutorial/modules.html > > Hint - you can't just copy a script around and expect it to work. The > script depends on other files to make it all happen. > > If in python, you type, > > import sys > sys.path > > ... and you see something like C:\first\Python26\Lib\site-packages, it > should work fine assuming Django was installed using setuptools or > pip. If not, you should look into using that instead of manually > installing it. > > If you insist on doing it manually, you need to look into creating a > .pth file to add the packages into the PYTHONPATH. > > On 25 August 2010 18:06,gintare<g.statk...@gmail.com> wrote: > > > > > I am not able to run django under windows7 > > > python django-admin.py #is recognized if i paste it to c:/first/ > > Python26 together with python executable. > > > I am getting error: No module named django.core > > File "django-admin.py", line2, in <module> > > from django.core import management > > > It seems the command line do not know about variables in the path: > > Python django-admin.py #is not recognized if i use path variable > > "C:/first/Python26/Lib/site-packages/django-1.2.1/django/bin" > > It is recongmized as a command in if paste it to C:/first/Python26. > > > I added paths to System Path Variable: > > C:/first/Python26 > > which contains copy af django-admin.py > > C:/first/Python26/Scripts which > > contains copy af django-admin.py > > C:/first/Python26/Lib/site-packages/django-1.2.1/django/bin - > > original django-admin.py > > > I run from command line cmd beeingin c:/first/Python26 > > python # command works > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.