0

I am new to virtual environment concept in python and I am confused with something which may arise because of my lack of knowledge in general computer science. I know that whenever I want to create a python .py file in spyder, I set my desired directory as my working directory in spyder (for example driver D). What if I want to create a virtual directory? I mean I've created a virtual directory with some instructions on the internet and it successfully created in this path:

C:\Users\my_name\AppData\Local\Continuum\anaconda3\envs

If I want to create a new python .py file in that virtual environmrnt, should I set the directory in spyder, the above mentioned path?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
mpy
  • 622
  • 9
  • 23

1 Answers1

1

You don't need to create a python file in that directory, you can create it anywhere in any directory. You just need to activate/choose the environment before running that python file.

Also virtual environments can be created anywhere but that's not recommended.

Krishna
  • 6,107
  • 2
  • 40
  • 43
  • Does it mean than whenever I activate that environment and open different python files in different directories, all of them would use that virtual environment with those specific installed packages? – mpy Oct 07 '19 at 12:49
  • 1
    Yes. If you're using linux your command prompt will show the activated environment too! like - `(venv)user@ubuntu~$` – Krishna Oct 07 '19 at 12:52