pyenv is a Python version management. It installs/uninstalls different Python versions, sets global and local(directory) Python version. pyenv-virtualenv is a pyenv plugin that manages Python virtual environments on UNIX-like systems.
As you see, if we are integrating both the frontend and machine learning setup, we need to use the python virtualenv. If we are going to use only the data science or machine learning setup, it's good to use the anaconda itself.
venv is an environment manager for Python . conda is both a package and environment manager and is language agnostic . Whereas venv creates isolated environments for Python development only, conda can create isolated environments for any language (in theory).
Then use virtualenv or venv. These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
Edit: It's worth mentioning pip
here as well, as conda
and pip
have similarities and differences that are relevant to this topic.
pip: the Python Package Manager.
pip
as the python equivalent of the ruby gem
commandpip
is not included with python by default.brew install python
sudo easy_install pip
gemfile
pip freeze > requirements.txt
pyenv: Python Version Manager
pyenv
lets you manage this easily.virtualenv: Python Environment Manager.
virtualenv
, simply invoke virtualenv ENV
, where ENV
is is a directory to place the new virtual environment.virtualenv
, you need to source ENV/bin/activate
. To stop using, simply call deactivate
.virtualenv
, you might install all of a workspace's package requirements by running pip install -r
against the project's requirements.txt
file.Anaconda: Package Manager + Environment Manager + Additional Scientific Libraries.
conda install <packagename>
miniconda
version, which seems like it could be a more simple option than using pip
+ virtualenv
, although I don't have experience using it personally.conda
allows you to install packages, these packages are separate than PyPI packages, so you may still need to use pip additionally depending on the types of packages you need to install. See also:
Simple analogy:
Since I use python3 I prefer the python3 built-in virtual environment named venv. venv is simple and easy to use. I would recommend you to read its official docs. The doc is short and concise.
In ruby, we don't really need a virtual environment because the bundler takes care of it. Both virtual env and bundler are great, however, they have different solutions to solve the same problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With