4 ms·
This tells me why a virtual environment is good, but not why a Conda venv is good. Am I missing something? Why not just use pip?
by bransonf 7y ago
This tells me why a virtual environment is good, but not why a Conda venv is good. Am I missing something?
Why not just use pip?
- tel 7y agoConda can manage a few things beyond just Pip. Things like binaries, system libs, R installs. I'm not entirely convinced that's a good thing, but it's an easy path to managing those sorts of libraries alongside your Python libs.
- RobinL 7y agoOne reason it can be very useful is that a conda environment gives data scientists a super easy way to Dockerise their code. Binder (https://mybinder.org/ https://mybinder.org/) is a good example of how well this can work - anyone can reproduce your work using e.g. Jupyter hosted on a binder, build from a conda env.
- Gimpei 7y agoConda takes care of a lot of other useful things. For example, it will install cuda and cudnn for you. It will also install mkl. So much easier than pip + many other steps.
- jhrmnn 7y agoConda virtual environments and Pip are orthogonal. Pip can be used to install into venvs. But as to why use conda rather than just the standard library venv module (python3 -m venv venv): conda can easily manage multiple python versions. In my experience, it's the most hassle-free option compared to something like pyenv. I personally use conda just for managing venvs, and don't use its package manager functionality at all.
- dfsegoat 7y agoFWIW our use case is the same: - Conda to manage multiple python versions on 1 box: $ conda create -n env27 python=2.7 $ conda create -n env37 python=3.7 - Pip to manage packages in the environment: $ source activate env27 $ pip install -r requirements_27.txt
- qwerty456127 7y agoBut why would anybody need a Python version other than the latest? Aren't they backward-compatible within a major version? Won't everything written for Python 3.7 work on 3.8 and everything written for 2.6 work on 2.7?
- meritt 7y agoI'm by no means a Python expert but I recently had a small project where I needed to convert the output of an SQL query to a parquet file, and I settled on using fastparquet to do so. I first tried using pip under a venv to install it, and I ran into dependency hell. I needed various dev libs and build-essential on my ubuntu box and I ultimately couldn't get it to compile llvmlite correctly (linker issuers and way too many LLVM versions). I finally gave up and tried miniconda on a fresh box per some advice here on HN. I simply installed it, ran "conda create -n myenv fastparquet" and it just worked first try. No extra effort involved.