Where is pyvenv script in Python 3 on Windows installed?

爷,独闯天下 提交于 2019-12-05 02:21:33

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 that Windows finds Python script placed on the PATH when typing script's name 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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!