Search code examples
installationcondapython-sacred

python package can be installed by pip but not conda


I need the sacred package for a new code base I downloaded. It requires sacred. https://pypi.python.org/pypi/sacred

conda install sacred fails with PackageNotFoundError: Package missing in current osx-64 channels: - sacred

The instruction on the package site only explains how to install with pip. What do you do in this case?


Solution

  • That package is not available as a conda package at all. You can search for packages on anaconda.org: https://anaconda.org/search?q=sacred You can see the type of package in the 4th column. Other Python packages may be available as conda packages, for instance, NumPy: https://anaconda.org/search?q=numpy

    As you can see, the conda package numpy is available from a number of different channels (the channel is the name before the slash). If you wanted to install a package from a different channel, you can add the option to the install/create command with the -c/--channel option, or you can add the channel to your configuration conda config --add channels channel-name.

    If no conda package exists for a Python package, you can either install via pip (if available) or build your own conda package. This isn't usually too difficult to do for pure Python packages, especially if one can use skeleton to build a recipe from a package on PyPI.