constructor icon indicating copy to clipboard operation
constructor copied to clipboard

Use packages from pip in the environment file

Open vigneshmanick opened this issue 4 years ago • 3 comments

My construct.yaml is as follows

name: TestPackage
version: 0.0.1
channels:
  - http://repo.anaconda.com/pkgs/main/

environment_file: environment.yml

license_file: EULA.txt

and the environment.yml is as follows


channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.8
  - pip
  - conda
  - pip:
    - black
    - somepackage-0.0.1-cp38-cp38-linux_x86_64.whl

when construct . is called, i see that the output shows that the packages from pip are being installed in the temporary environment but don't show up in the created installer (both black and somepackage )

Any suggestions on what might be happening here?

Thanks!

vigneshmanick avatar Apr 01 '22 12:04 vigneshmanick

@vigneshmanick did you happen upon any workarounds for this? Having a similar problem.

iamed18 avatar Jul 19 '22 04:07 iamed18

@iamed18 nope, haven't found any alternative. Also since i haven't heard back from any of the developers, my current approach is to compile python manually and add the necessary packages using pip and use that artifact.

vigneshmanick avatar Jul 20 '22 10:07 vigneshmanick

The environment-file capabilities only uses that file to create temporary environment, and from that env it takes the conda packages returned by the solve. It doesn't really look for anything pip related. The fact that the pip parts are executed during the temporary env creation is more of an oversight at this moment.

For now, you could have a post-install script that adds the pip packages as needed, but this is not very reproducible and could bork the files installed by conda at that point, so proceed with caution. Recommendation: use direct URLs to the wheels and use --no-deps whenever possible.

jaimergp avatar Aug 15 '22 10:08 jaimergp