Python Virtual Environments in Windows, virtualenv, lsvirtualenv, venv

Useful commands from command line:
  • lsvirtualenv to view virtual environments
  • C:\Dev\venv\Scripts\activate to activate the virtual environment located in C:\Dev\venv\
Other notes on PyCharm:
  • PyCharm’s built-in Terminal does NOT work as an external command line. I witnessed different error messages (formatted differently, less detailed) in the built-in Terminal. In one case, python did NOT work from the built-in Terminal, while the same command worked from a normal command line.
  • If the packages you install need for some reason Visual Studio C++ of some version, it did NOT help me to add to the PATH the directories where my Visual Studio C++ was located (namely, set PATH=C:\Users\%USERNAME%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64;C:\Users\%USERNAME%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Bin\x64;C:\Users\%USERNAME%\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\WinSDK\Bin;%PATH%). Instead, press “Start”, then search for “Visual C++ Command Prompt” or something like that, and this command prompt already includes in its %PATH% variable the relevant directories.
Other notes on python:
  • — Unofficial Windows Binaries for Python Extension Packages