问题
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?
回答1:
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, see https://conda.io/docs/build_tutorials.html. 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.
回答2:
It happens some issue to me before. If your system default Python environment is Conda, then you could download those files from https://pypi.python.org/pypi/sacred#downloads and manually install by
pip install C:/Destop/some-file.whl
来源:https://stackoverflow.com/questions/45471477/python-package-can-be-installed-by-pip-but-not-conda