Where is pyvenv script in Python 3 on Windows installed? Where is pyvenv script in Python 3 on Windows installed? windows windows

Where is pyvenv script in Python 3 on Windows installed?


It looks like pyvenv script is placed in Tools\Scripts subfolder inside Python installation folder (sys.prefix). It seems like copying it to Scripts subfolder is a good idea as it allows to simply type pyvenv from the command line (assuming Scripts folder is already on the PATH). As there's no exe wrapper for this script one has to make sure

  • .py extension is added to PATHEXT environment variable so thatWindows finds Python script placed on the PATH when typing script'sname at the command prompt.
  • .py extension is associated either with Python executable or with Python launcher (py.exe) which is available starting from Python 3.3

Alternatively one can just type python -m venv instead of pyvenv and save himself all of the hassle...

Related Python bug 17480 - pyvenv should be installed someplace more obvious on Windows


Use python -m venv someenvname instead.

Moreover, there is no strong reason to add python folder to PATH if you use system-wide python.exe only for creating virtual environments.