0

I have an environment.yml file for building my conda environment, where one package (a python wrapper to another) depends on the .h/.so files provided by another. Let's say:

   channels:
     - defaults
     - conda-forge

   dependencies:
     - blah=1.2.1
     - pip:
       - git+https://github.com/pyBlah.git

The blah package by itself installs correctly, and the header/.so files are indeed installed at the appropriate location (inside the conda environment's include and lib folders respectively), but the pip install line fails because it fails to find the headers.

I could remove the pip line in environment.yml above and try to install it after creating/activating the environment, like so:

CFLAGS=-I/path/to/env/include LDFLAGS=-L/path/to/env/lib pip install git+https://github.com/pyBlah.git

or follow something like Conda set LD_LIBRARY_PATH for env only to avoid having to explicitly indicate paths during pip install, but having to do either of these seems like providing too much detail, and breaking what should have been one single installation step into many.

My thinking is that conda must be doing something like this internally to resolve/build/install related packages that it finds in environment.yml anyway.

So my questions is twofold:

  1. Is there a reason conda doesn't add appropriate include/lib paths automatically, since otherwise how is pip (which is environment-specific after all) expected to do it's job properly once the environment is activated?

  2. Is there a canonical way of accomplishing dependent package installations just using appropriate specifiers in environment.yml?

Vineet Bansal
  • 491
  • 1
  • 4
  • 14
  • Did you somehow install pip via conda, in addition to the system pip? – Pierre de Buyl Jan 09 '19 at 14:06
  • Yes - the pip I refer to in the question is the conda environment-specific pip, installed through 'conda install pip' – Vineet Bansal Jan 09 '19 at 15:24
  • 1. Because the package maintainer didn't specify that the flags should be changed for that environment. You should also try to see if there is a conda package for the wrappers, and if not, build one. 2. Not as far as I know. If you put the actual package it will be easer to help – darthbith Jan 09 '19 at 22:50

0 Answers0