Using Virtual Environment in Powershell
Create the virtual environment
PS C:\Users\mgarcia\Documents\Work\ml> python -m venv venv
PS C:\Users\mgarcia\Documents\Work\ml> python -m pip --version
pip 21.1.1 from C:\Python39\lib\site-packages\pip (python 3.9)
PS C:\Users\mgarcia\Documents\Work\ml>
PS C:\Users\mgarcia\Documents\Work\ml> . venv/Scripts/activate
(venv) PS C:\Users\mgarcia\Documents\Work\ml>
(venv) PS C:\Users\mgarcia\Documents\Work\ml> pip install jupyter matplotlib numpy pandas scipy scikit-learn
Registering the environment in Jupyter
(venv) PS C:\Users\mgarcia\Documents\Work\ml> python -m ipykernel install --user --name=python3
Installed kernelspec python3 in C:\Users\mgarcia\AppData\Roaming\jupyter\kernels\python3
(venv) PS C:\Users\mgarcia\Documents\Work\ml>
Powershell Execution Policy
PS C:\Users\mgarcia\Documents\Work\ml> . venv/Scripts/activate
. : File C:\Users\mgarcia\Documents\Work\ml\venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ . venv/Scripts/activate
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\mgarcia\Documents\Work\ml>
PS C:\Users\mgarcia\Documents\Work\ml> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
PS C:\Users\mgarcia\Documents\Work\ml> . venv/Scripts/activate
(venv) PS C:\Users\mgarcia\Documents> Get-ChildItem -Recurse -Directory 'ml'
Directory: C:\Users\mgarcia\Documents\Work
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 6/4/2021 2:50 PM ml
(venv) PS C:\Users\mgarcia\Documents>