Issue
First of all, to put in context:
I have installed Python 3.9 which comes from Visual Studio 2019
I have installed Python 3.8 from Microsoft Store which installs it in the path:
C:\Users\username\AppData\Local\Microsoft\WindowsApps
Now I want to create a virtual environment for Python 3.8 so I can switch to it whenever I need. So I follow below steps (below commands are all executed from path C:\Users\username\AppData\Local):
Installing virtualenv:
py -3.8 -m pip install virtualenv
Creating new virtual environment for Python 3.8:
py -3.8 -m virtualenv _venv38.win32
And what's the surprise? Folder _venv38.win32 is not created within the directory I am which is C:\Users\username\AppData\Local
Instead _venv38.win32 is created in:
C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\_venv38.win32
So why? I want it to be created in:
C:\Users\username\AppData\Local\_venv38.win32
which is the path from where I have executed the command (step 2)
Solution
use
py -3.8 -m venv _venv38.win32
this will create venv
at cwd
.
virtualenv
has a custom "remote"
location for virtual environments somewhere outside your project
Answered By - alexzander Answer Checked By - Senaida (WPSolving Volunteer)