How do I keep track of pip-installed packages in an Anaconda (Conda) environment?

后端 未结 10 2484
萌比男神i
萌比男神i 2020-11-28 00:35

I\'ve installed and have been using the Anaconda Python distribution, and I have started using the Anaconda (Conda) environment. I can use the standard conda install..

10条回答
  •  一整个雨季
    2020-11-28 01:06

    conda will only keep track of the packages it installed. And pip will give you the packages that were either installed using the pip installer itself or they used setuptools in their setup.py so conda build generated the egg information. So you have basically three options.

    1. You can take the union of the conda list and pip freeze and manage packages that were installed using conda (that show in the conda list) with the conda package manager and the ones that are installed with pip (that show in pip freeze but not in conda list) with pip.

    2. Install in your environment only the python, pip and distribute packages and manage everything with pip. (This is not that trivial if you're on Windows...)

    3. Build your own conda packages, and manage everything with conda.

    I would personally recommend the third option since it's very easy to build conda packages. There is a git repository of example recipes on the continuum's github account. But it usually boils down to:

     conda skeleton pypi PACKAGE
     conda build PACKAGE
    

    or just:

    conda pipbuild PACKAGE
    

    Also when you have built them once, you can upload them to https://binstar.org/ and just install from there.

    Then you'll have everything managed using conda.

提交回复
热议问题