Python virtual environment and pyvenv.cfg file

492 views Asked by At

I have questions regarding how virtual environment work. here is what I did:

  1. I created a python virtual environment on the network drive at \networkdrive_path\python_venv using computer A.

  2. on computer B, in the windows command window, I activate the virtual environment, however, after activation, when I type "python", it's not open python.exe in the virtual environment, but it's looking for python.exe in the path that stored in the "Home" variable in the pyvenv.cfg.

My question is: why it's searching python.exe in the path that stored in the "Home" variable in the pyvenv.cfg, instead of directly use python.exe in the \networkdrive_path\python_venv\scripts?

the "home" variable stores the python path that I used to create virtual environment on computer A. when I change the home path to the python path in computer B, it works when I type "Python" after activation.

0

There are 0 answers