Command not found: django-admin.py

前端 未结 27 1919
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 02:40

I am a complete beginner to Python/Django, but I want to dive right in and start experimenting. Thus I was following this guide on installing Python/Django http://devcenter.

相关标签:
27条回答
  • 2020-12-03 03:29

    I have used follwong command to install (/usr/local/bin) MAC OS

    pip install django
    
    django-admin startproject mysite
    
    0 讨论(0)
  • 2020-12-03 03:29

    For me this one worked

    python3 -m django startproject mysite
    

    Then it doesn't tell you that it created file you must check by yourself in your home

    hardrive/user/urhome
    
    0 讨论(0)
  • 2020-12-03 03:31

    I tried as the method, it worked.

    pip uninstall django
    sudo pip install django
    django-admin startproject example
    

    It worked well.

    0 讨论(0)
  • 2020-12-03 03:31

    I was facing the same issue.

    The issue resolved after I upgraded the django version using

    pip install --upgrade django
    

    Then run

    django-admin startproject mysite
    

    Hope this helps!

    0 讨论(0)
  • 2020-12-03 03:32

    Make sure you properly did the source bin/activate command. If you skip that, or do it in a different terminal window, or close the window then re-open it, you won't be in the virtualenv and you won't have access to the django-admin.py command in your environment.

    0 讨论(0)
  • 2020-12-03 03:32

    Get site-package path with Python:

    import site; site.getsitepackages()
    

    And run django-admin.py directly:

    python (your-site-package-addresss)/django/bin/django-admin.py startproject hellodjango
    



    On Mac: If this works you can go and add django-admin.py to your path using symlink:

    sudo ln -s (your-site-package-addresss)/django/bin/django-admin.py /usr/local/bin/django-admin
    

    (could be that you have to reopen terminal or reinstall django to get the symlink working)

    0 讨论(0)
提交回复
热议问题