Conda build unsatisfiable dependencies error with

2019-07-18 17:36发布

I have a valid pip package that I am trying to put onto the Anaconda.org server. I created the meta.yaml file with conda skeleton, which includes the requirement for pint (no particular version selected, so it should default to the latest.) However, when I attempt to build the package with conda build, conda raises this error: raise DependencyNeedsBuildingError(exc, subdir=subdir) conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: ['pint'] However, there is a pint that is built for osx-64... both in conda and in pip and on my machine - it's the one I use to run my pip package. What repository is conda hunting through to find that requirement and how can I specify the correct pint to use in meta.yaml?

1条回答
贼婆χ
2楼-- · 2019-07-18 17:42

Conda is hunting through the channels in your configuration, which you can view with the command

conda config --get channels

(or conda config --show). Conda build always installs packages from the repositories (which is to say it doesn't rely on packages you have installed locally) because that is what a general user will do when they install your package. In your case, you need to add a channel to pick up the pint package; you can find a suitable channel by searching on Anaconda.org, and in this case, the conda-forge channel (among others, but that's the one I'd recommend) has the pint package. You can add the channel to your configuration with

conda config --add channels conda-forge

or you can use it for this single build with the -c option to conda build:

conda build -c conda-forge your_pacakge_name

See conda-build for more information.

查看更多
登录 后发表回答