Newest version of virtualenv (16.7.2) on python v.3.7.4 has 4 additional lines for the "activate.ps1" script, which when run on Windows10 powe
Let's have a look at that error message:
You must 'source' this script: PS> . .\ENV\Scripts\activate
Hmmmm... - PS>
is probably just the prompt, which leaves us with this:
. .\ENV\Scripts\activate
# ^
# |
# Check out this guy
That, the lonely .
in front of the path, that is the dot-source operator in powershell.
According to the documentation, it:
Runs a script in the current scope so that any functions, aliases, and variables that the script creates are added to the current scope.
I haven't had a look at virtualenv
, but I assume it'll want to define a number of variables and to ensure that these persist after the script has run, it needs to be run in the current scope.
So this is the literal command you have to run to fix it:
. .\ENV\Scripts\activate
Screenshot attached for reference. I've just encountered the same issue but I did the following:
Create a new virtual environment;
python -m venv directory
Navigate into the newly created directory;
cd directory
Activate the virtual environment.
.\Scripts\activate
This resolved my problem. I hope it helps...
I have also faced this issue. To solve this I created a new virtualenvironment as follows:
python -m venv directory-name
To activate:
Scripts>./activate
And Now it's working fine...
I Also Faced the same issue solved it by using this :
Created A Virtual Environment By : virtualenv environment
After Creating Virtual Environment
I activated it by using :
source environment/bin/activate
And It activated my Virtual Environment