Does Conda replace the need for virtualenv?

后端 未结 8 594
时光取名叫无心
时光取名叫无心 2020-11-27 09:42

I recently discovered Conda after I was having trouble installing SciPy, specifically on a Heroku app that I am developing.

With Conda you create environments, very

相关标签:
8条回答
  • 2020-11-27 10:09

    Installing Conda will enable you to create and remove python environments as you wish, therefore providing you with same functionality as virtualenv would.

    In case of both distributions you would be able to create an isolated filesystem tree, where you can install and remove python packages (probably, with pip) as you wish. Which might come in handy if you want to have different versions of same library for different use cases or you just want to try some distribution and remove it afterwards conserving your disk space.

    Differences:

    License agreement. While virtualenv comes under most liberal MIT license, Conda uses 3 clause BSD license.

    Conda provides you with their own package control system. This package control system often provides precompiled versions (for most popular systems) of popular non-python software, which can easy ones way getting some machine learning packages working. Namely you don't have to compile optimized C/C++ code for you system. While it is a great relief for most of us, it might affect performance of such libraries.

    Unlike virtualenv, Conda duplicating some system libraries at least on Linux system. This libraries can get out of sync leading to inconsistent behavior of your programs.

    Verdict:

    Conda is great and should be your default choice while starting your way with machine learning. It will save you some time messing with gcc and numerous packages. Yet, Conda does not replace virtualenv. It introduces some additional complexity which might not always be desired. It comes under different license. You might want to avoid using conda on a distributed environments or on HPC hardware.

    0 讨论(0)
  • 2020-11-27 10:22
    1. Conda replaces virtualenv. In my opinion it is better. It is not limited to Python but can be used for other languages too. In my experience it provides a much smoother experience, especially for scientific packages. The first time I got MayaVi properly installed on Mac was with conda.

    2. You can still use pip. In fact, conda installs pip in each new environment. It knows about pip-installed packages.

    For example:

    conda list
    

    lists all installed packages in your current environment. Conda-installed packages show up like this:

    sphinx_rtd_theme          0.1.7                    py35_0    defaults
    

    and the ones installed via pip have the <pip> marker:

    wxpython-common           3.0.0.0                   <pip>
    
    0 讨论(0)
提交回复
热议问题