python - What is the relationship between virtualenv and pyenv? -
i learned how use virtualenv , virtualenvwrapper in workflow i've seen pyenv mentioned in few guides can't seem understanding of pyenv , how different/similar virtualenv. pyenv better/newer replacement virtualenv or complimentary tool? if latter differently , how 2 (and virtualenvwrapper if applicable) work together?
pyenv , virtualenv different tools work in different ways different things:
pyenv bash extension - not work on windows - intercepts calls python, pip, etc., direct them 1 of several of system python tool-chains. have libraries have installed in selected python version available - such users have switch between different versions of python.
virtualenv, pure python works everywhere, makes copy of, optionally specific version of, python , pip local activate environment may or may not include links current system tool-chain, if not can install known subset of libraries environment. such better testing , deployment know exactly libraries, @ versions, used , global change not impact module.
venv python > 3.3
note python 3.3 onward there built in implementation of virtualenv called venv (with, on installations wrapper called pyvenv - wrapper deprecated in python 3.6), should used in preference. avoid possible issues wrapper idea use directly using /path/to/python3 -m venv desired/env/path
or can use excellent py
python selector on windows py -3 -m venv desired/env/path
. create directory specified desired/env/path
configure , populate appropriately. in general using virtualenv.
additional tools
there number of tools worth mentioning, , considering, can use of 1 or more of above:
- virtualenvwrapper manage , simplify use , management of virtualenv - cross platform.
- pyenv-virtualenv, installed pyenv-installer, gives pyenv tools managing , interfacing virtualenv - can have base installation includes more 1 version of python , create isolated environments within each of them - linux/os-x. suggested johann visagie
- pyinstaller can take python code, possibly developed & tested under virtualenv, , bundle can run 1 platforms not have your version of python installed - note not cross compiler need windows (virtual-)machine build windows installs, etc., can handy can sure python installed cannot sure version of python , libraries compatible code.
Comments
Post a Comment