-1

I'm trying to learn Django. To start, I needed to install Python, Django, and Virtualenv. These are all installed with no errors. But now that I want to start a project and run virtualenv, I can't activate it in the powershell.

I used this command to make a virtualenv:

python -m virtualenv venv

Now the tutorial says that I have to activate virtualenv like this:

. \scripts\activate

but it gives me this error:

    . : The term '\scripts\activate' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:3
+ . \scripts\activate
+   ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (\scripts\activate:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What should I do?

I have tried scripts\activate.ps1 but it still is not working.

Sadraw
  • 79
  • 1
  • 12

2 Answers2

2

You should to use scripts\activate.ps1 instead of scripts\activate. Find more info here

  • `activate.ps1 : The term 'activate.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + activate.ps1 + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (activate.ps1:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException` – Sadraw May 17 '21 at 07:01
  • It works completely fine on Cmd but it doesn't work on Powershell. I tried it as an admin too. Still not working – Sadraw May 17 '21 at 07:12
0

It works perfectly with cmd, and not Powershell.

Sadraw
  • 79
  • 1
  • 12
  • I actually found a way in which I could activate it in PowerShell as well: env/scripts//activate – Sadraw Jun 08 '21 at 12:15