# Changing env from Django 2.2 to 4.0.1

**URL:** <https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924>\
**Category:** Getting Started\
**Created:** [February 1, 2022, 1:55pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924 "2022-02-01T13:55:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sinisteralex](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinisteralex/32/7293_2.png) [@sinisteralex](https://forum.djangoproject.com/u/sinisteralex)\
**Post date:** [February 1, 2022, 1:55pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924/1 "2022-02-01T13:55:50Z")

</div>

Hello

I am going through the Polls-tutorial.  
I have Django 4.0.1 installed and Python 3.9 on my Windows computer.

For some reason i have messed this up and the Django i am using is 2.2.  
I am using VSCode to go through the tutorial.  
I want to switch to 4.0.1 so i, in particular, can use @admin.display.

Thanks for any help

---

<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:** [February 1, 2022, 2:02pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924/2 "2022-02-01T14:02:19Z")

</div>

Can you provide more specific details about how you installed Python and Django on your computer?

Do you have them set up as a system wide, or as a user-based installation? Are you using a Python virtual environment (venv) or a global instance?

Leave VSCode aside for the moment; are you having the same issues if you try to start this using the command line?

(Part of the diagnostic process here is figuring out if the issue is with the installation or with your VSCode configuration.)

---

<div class="post-metadata">

**Author:** ![sinisteralex](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinisteralex/32/7293_2.png) [@sinisteralex](https://forum.djangoproject.com/u/sinisteralex)\
**Post date:** [February 1, 2022, 2:38pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924/3 "2022-02-01T14:38:29Z")

</div>

“Can you provide more specific details about how you installed Python and Django on your computer?”

- I installed Python via the [python.org](http://python.org) and it is version 3.9  
Django i installed via cmd-line with pip install django.  
Then i verified the Django-install with \*python -m django --version \* that returns version 4.01.

“Do you have them set up as a system wide, or as a user-based installation?”

- The installation is for “all users”

“Are you using a Python virtual environment (venv) or a global instance?”

- Not entirely sure what this means, i am using a venv in VSCode

“Leave VSCode aside for the moment; are you having the same issues if you try to start this using the command line?”

- Yes, cannot start it from the cmd line

This is from my current VSCode-project for the Polls-tutorial

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/3/351f8fd398a26f05ea5a0f01fef0315a648eee6a.png)

---

<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:** [February 1, 2022, 3:14pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924/4 "2022-02-01T15:14:33Z")

</div>

> [@sinisteralex](#):
>
> “Are you using a Python virtual environment (venv) or a global instance?”
> 
> - Not entirely sure what this means, i am using a venv in VSCode

How did you create the venv? Clearly, it’s showing a different version of Django than what you reported earlier.

> [@sinisteralex](#):
>
> are you having the same issues if you try to start this using the command line?”
> 
> - Yes, cannot start it from the cmd line

Please elaborate:

- Identify what your current directory is
- Show the complete commands you are entering
- Report the specific and complete error messages being returned.
- Also show the output from:
  - python -V
  - pip list

---

<div class="post-metadata">

**Author:** ![sinisteralex](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/sinisteralex/32/7293_2.png) [@sinisteralex](https://forum.djangoproject.com/u/sinisteralex)\
**Post date:** [February 1, 2022, 3:52pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924/5 "2022-02-01T15:52:49Z")

</div>

“How did you create the venv? Clearly, it’s showing a different version of Django than what you reported earlier.”

In VSCode - it does it automatically when i use the Python Django - debugger

“Please elaborate”  
Identifying my current directory and the complete command i am entering

C:\Users\tesve\source\repos\LearningDjango\LearningDjango\>py manage.py runserver  
The system cannot find the path specified.

_I edited the code since i misunderstood your question_

python -V  
returns Python 3.9 .10

pip list  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/8/8a8b2be63cc55609518a6153af73e81425738784.png)

---

<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:** [February 3, 2022, 1:50pm UTC](https://forum.djangoproject.com/t/changing-env-from-django-2-2-to-4-0-1/11924/6 "2022-02-03T13:50:35Z")

</div>

> [@sinisteralex](#):
>
> C:\Users\tesve\source\repos\LearningDjango\LearningDjango\>py manage.py runserver

What is this command `py` that you’re trying to run? Is that a cmd file you’ve built?
