-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.

2 Answers 2

2

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

2
  • 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, 2021 at 7: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, 2021 at 7:12
0

It works perfectly with cmd, and not Powershell.

1
  • I actually found a way in which I could activate it in PowerShell as well: env/scripts//activate
    – Sadraw
    Jun 8, 2021 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.