2

I am following a tutorial on https://djangogirls.org/ and I am frustratingly running into issues installing django or any other package. Per the tutorial, after creating and activating a Virtual Env, I was instructed to create a requirements.txt file in the project folder with the following line:

Django ~= 2.0.6

This always leads to this error:

 Could not find a version that satisfies the requirement Django~=2.0.6 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for Django~=2.0.6 (from -r requirements.txt (line 1))

I'm not sure what is going on. I also tried:

python3 -m pip install --pre --upgrade Django==2.0.6

But I also get:

 Could not find a version that satisfies the requirement Django==2.0.6 (from versions: )
No matching distribution found for Django==2.0.6

Please help. I can't continue the tutorial without resolving this. thank you

1
  • Did you update your version of pip? python -m pip install --upgrade pip Also, Django is beyond version 3 now---almost ready to release version 4 by year end.
    – Bobort
    Commented Nov 17, 2021 at 19:53

1 Answer 1

0

If yop ur a MAc user follow the steps:

STEP ONE

Create a directory for your project & install virtual env.

mkdir projects
cd projects
python3 -m venv myprojectvenv

STEP TWO

we will activate the virtual env

source myprojectenv/bin/activate

Output

(myprojectenv) .....

STEP THREE

Will install Django in our virtual environment .

(myprojectenv)$ pip3 install django 

This will install the latest Django version. if you need a specific version then you can run

(myprojectenv)$ pip3 install django==2.0.5

Make sure you install Django in your active virtual env. Also if you need to check what packages you have installed, you can run:

pip freeze

Hope this works with you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .