Django manage.py syncdb not working?

Trying to learn Django, I closed the shell and now get this problem when I call python manage.py syncdb, any idea what happened ?:

I have already installed db. I installed manage.py in the django_bookmarks folder. What is here?

Traceback (most recent call last):
  File "manage.py", line 2, in <module>
    from django.core.management import execute_manager
ImportError: No module named django.core.management
my-computer:~/Django-1.1.1/django_bookmarks mycomp$ export PATH=/Users/mycomp/bin:$PATH
my-computer:~/Django-1.1.1/django_bookmarks mycomp$ python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 2, in <module>
    from django.core.management import execute_manager
ImportError: No module named django.core.management
my-computer:~/Django-1.1.1/django_bookmarks mycomp$ 
+3
source share
2 answers

It seems that Django is not available in any of your PYTHONPATH directories.

Check if django is available on the command line:

$ python -c 'import django'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named django
$ # crash and burn...

Assuming you got this error, add the path to django in PYTHONPATH.

$ export PYTHONPATH=/path/to/django:$PYTHONPATH
$ python -c 'import django'
$ # hurray!

If you extracted Django-1.1.1.tgz to ~ / Django-1.1.1, use "~ / Django-1.1.1" and not "~ / Django-1.1.1 / django" for / path / to / Django .

+7
source

VirtualEnv? .

0

Source: https://habr.com/ru/post/1743281/


All Articles