# Cannot Start Django Project with "django-admin startproject project"

**URL:** <https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286>\
**Category:** Using Django\
**Created:** [September 10, 2020, 2:06pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286 "2020-09-10T14:06:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![R4356th](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/r4356th/32/2052_2.png) [@R4356th](https://forum.djangoproject.com/u/R4356th)\
**Post date:** [September 10, 2020, 2:06pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/1 "2020-09-10T14:06:04Z")

</div>

I tried to run the command

```auto
django-admin startproject app

```

but it gave me the following error-

```auto
'django-admin' is not recognized as an internal or external command,
operable program or batch file.

```

. I executed

```auto
pip3 uninstall Django

```

and the result was

```auto
Found existing installation: Django 3.1.1
Uninstalling Django-3.1.1:
  Would remove:
    c:\users\radma\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\scripts\django-admin.exe
    c:\users\radma\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\scripts\django-admin.py
    c:\users\radma\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages\django-3.1.1.dist-info\*
    c:\users\radma\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages\django\*
Proceed (y/n)?

```

I use Windows 10 and Django used to work fine but I had to reset Windows so all my data in C drive was erased and when I tried to use Django today, this happened.

---

<div class="post-metadata">

**Author:** ![R4356th](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/r4356th/32/2052_2.png) [@R4356th](https://forum.djangoproject.com/u/R4356th)\
**Post date:** [September 10, 2020, 2:14pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/2 "2020-09-10T14:14:19Z")

</div>

I reinstalled Django and got these warnings-

```auto
  WARNING: The script django-admin.exe is installed in 'C:\Users\radma\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

```

```auto
WARNING: You are using pip version 20.1.1; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\radma\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.

```

. The second one seems to be easy to fix but I do not know how to fix the first one. Could someone please help me?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 10, 2020, 2:49pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/3 "2020-09-10T14:49:08Z")

</div>

Rather than trying to install / manage your Django installation globally, I would recommend you create your development environment(s) using a Python virtual environment.

See the following for further information:

- [https://docs.python.org/3/library/venv.html](https://docs.python.org/3/library/venv.html)
- [https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/)
- [https://pypi.org/project/virtualenvwrapper-win/](https://pypi.org/project/virtualenvwrapper-win/)

---

<div class="post-metadata">

**Author:** ![R4356th](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/r4356th/32/2052_2.png) [@R4356th](https://forum.djangoproject.com/u/R4356th)\
**Post date:** [September 10, 2020, 4:58pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/4 "2020-09-10T16:58:27Z")

</div>

Thank you but I am not interested in that actually.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 10, 2020, 5:03pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/5 "2020-09-10T17:03:40Z")

</div>

That’s your call, but it is contrary to the [documented best practices](https://docs.djangoproject.com/en/3.1/howto/windows/#setting-up-a-virtual-environment) for [running Django in a Windows environment](https://docs.djangoproject.com/en/3.1/howto/windows/#how-to-install-django-on-windows).

---

<div class="post-metadata">

**Author:** ![R4356th](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/r4356th/32/2052_2.png) [@R4356th](https://forum.djangoproject.com/u/R4356th)\
**Post date:** [September 11, 2020, 6:57pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/6 "2020-09-11T18:57:09Z")

</div>

I set up my virtual environment but it did not work. ☹

---

<div class="post-metadata">

**Author:** ![R4356th](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/r4356th/32/2052_2.png) [@R4356th](https://forum.djangoproject.com/u/R4356th)\
**Post date:** [September 18, 2020, 5:46pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/7 "2020-09-18T17:46:53Z")

</div>

Bump``

---

<div class="post-metadata">

**Author:** ![Spidiffpaffpuff](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/spidiffpaffpuff/32/1557_2.png) [@Spidiffpaffpuff](https://forum.djangoproject.com/u/Spidiffpaffpuff)\
**Post date:** [September 18, 2020, 6:10pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/8 "2020-09-18T18:10:19Z")

</div>

It seems that your python installation is broken, which makes sense, when your system drive was reset. Entirely uninstall python. Reinstall it properly. During the installation it will prompt you to add stuff to your PATH variable. Do that and when you’re done, try setting up a virtual environment properly. Once that has worked, install django into that virtual environment.  
When your virtual environment is active, make sure you only use “pip” and not “pip3” or any other versions. The venv overwrites “pip” and “python”, but not the rest.

---

<div class="post-metadata">

**Author:** ![R4356th](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/r4356th/32/2052_2.png) [@R4356th](https://forum.djangoproject.com/u/R4356th)\
**Post date:** [September 19, 2020, 2:59pm UTC](https://forum.djangoproject.com/t/cannot-start-django-project-with-django-admin-startproject-project/4286/9 "2020-09-19T14:59:56Z")

</div>

Thank you very much! That worked! 😃
