Environment: Ubuntu, python2.7, django1.9.5
When you create a corresponding Django project with django-admin.py Startproject ProjectName, a solution with command not found:django-admin.py occurs:
- Locate the path of the corresponding file django-admin.py:
To run the related command:
- Then switch to the corresponding directory: Cd/home/zhanglei/.local/lib/python2.7/site-packages/django/bin (the path you see in the first step)
You can see that the django-admin.py file exists under the corresponding directory
- Then establish a soft connection: sudo ln-s/home/zhanglei/.local/lib/python2.7/site-packages/django/bin/django-admin.py/usr/local/bin/ django-admin.py
- Switch to the directory where you want to create the project, run the command: django-admin.py startproject Testdjango to see that the Testdjango project was created successfully.
django-admin.py creating a project failure workaround