简体   繁体   中英

activating virtual environment on windows using powershell

Im following this tutorial: https://www.codingforentrepreneurs.com/blog/install-python-django-on-windows/

on step 7, I tried running pipenv shell in the same directory called cfehome, and also in a different directory, but it doesnt say the (cfehome) before the path, so i thought it hadnt been activated, but when I run the command again, it says environment already activated.

Also, the tutorial states when i run pip freeze, i should get no output. but i do get an output with the names of different libraries.

I followed all other steps and they gave the desired output so I dont know why this step is not?

for more details, you can take a look at stackoverflow virtualenv-wont-activate-on-windows 4th answer by Do Nhu Vy. He has explained in detail taking screenshots one by one.

On Windows, open Windows PowerShell as Administrator

create a virtual environment

pip install virtualenv
virtualenv foo      
cd .\foo
.\Scripts\activate
  1. install virtual environment by running command pip install virtualenv
  2. make a virtual environment by running command virtualenv env_name , here env_name is name of virtual environment
  3. go into virtaul environment directory by cd cd.\env_name
  4. activate virtual environment by command .\Scripts\activate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM