Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda dependencies do not install on local package build

Tags:

python

conda

I am building a Python package using conda-build. Right now, my structure looks like this:

- my_recipe/
    - meta.yaml
    - build.sh

And my meta.yaml reads thusly:

package:
  name: my_pkg
version: "0.2.0"

source:
  path: ../my_pkg

requirements:
  build:
    - python
    - setuptools
  run:
    - python
    - pandas
    - numpy
    - plotly
    - matplotlib
    - pyqtgraph
    - pyopengl
    - gdal
    - scipy
    - scikit-image

The package itself builds correctly when I run

conda-build my_recipe/

and it installs successfully when I run

conda install -n my_env --use-local ~/miniconda3/envs/my_env/conda-bld/linux-64/my_pkg-0.2.0-py36_0.tar.bz2

However, none of the dependencies listed under run seem to install along with the package. For example, when I import the package in Python it says that pandas could not be found.

Are my dependencies listed in the correct location? Do I also need to list the dependencies in setup.py? The documentation is not very clear on where this information should be.

like image 897
Bryce Frank Avatar asked Apr 13 '18 18:04

Bryce Frank


1 Answers

I've had luck telling conda to treat the local directory as a channel:

conda install my-package-name -c file:///FULL_PATH_TO_CONDA/envs/my_env/conda-bld/

I figured this out based on instructions here, although note I didn't have to run conda index first because conda build had already created repodata.json files.

like image 88
Singularity Avatar answered Oct 30 '22 12:10

Singularity