0

I cant switch my virtual environments in the command prompt. i'm new to coding so bare me. i'm running it in windows and most of the documentation i've found is using linux or mac. First I create the virtual environment directory, but then when I type activate, it uses an old virtual environment that I first created. How do I switch into the new one i create? All help is appreciated.

Cflux
  • 1,423
  • 3
  • 19
  • 39

2 Answers2

0

I suggest looking into virtual env wrapper for Windows. It's a Windows port Virtualenvwrapper, which makes managing of virtual environments in your machine easier.

Ed Patrick Tan
  • 727
  • 1
  • 9
  • 15
  • when i pip list outside of the virtual env, it says I have virturalenvwrapper-win (1.2.1) – Cflux Feb 01 '16 at 03:35
0

Check which folder are you located in when you type activate, it must be the old virtualenv folder. To activate the new virtualenv change your folder to \path_to_new_virtualenv\Scripts\ and then give activate.

Moreover, while using virtualenv the best practice is to use virtualenvwrapper. It makes it easiar to manage different virtualenvironments. You should keep all your virtualenvs in a separate folder and virtualenvwrapper does it for you. If you have it installed, just make a folder Envs in your user home folder. Then you just need to give

mkvirtualenv <venv name> 

to create a new virtualenv and

workon <venv name>

to activate the same venv, for more commands go to virtualenvwrapper for Windows

Animesh Kumar
  • 162
  • 3
  • 5
  • Thanks Animesh,I'll give it a try. I have virtualenvwrapper-win (1.2.1) installed currently in the root system. – Cflux Feb 04 '16 at 14:29
  • okay just tried it. I can activate from anywhere in the system it seems and then if i want to switch to another env, I have to use the workon command and then whatever the name is of the env. i've tried searching my comp for the folder where it opens the original one but no luck. yet is there a way to change the root directory for where it pulls the command from? – Cflux Feb 04 '16 at 14:33