Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Python Conda Environment in Heroku

Background

I created a heroku instance in my project directory using the guide here for a conda environment: conda-buildpack

Error

sterlingbutters$ git push heroku master
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 2.68 KiB | 2.68 MiB/s, done.
Total 7 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python/Conda app detected
remote: -----> Preparing Python/Miniconda Environment (3.8.3)
remote: /app/tmp/buildpacks/2abac4b7166986c6b1b33fcacccb13fb4e2036a9358f31ed8886bbf37c9987c7fbb8243090f0438ebbf02852a1cbeb1b5cae47f67dc2670115ce6d7bd2468300/bin/steps/conda_compile: line 9: conda: command not found
remote:  !     Push rejected, failed to compile Python/Conda app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to openmc-dash-interface.
remote: 
To https://git.heroku.com/openmc-dash-interface.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/openmc-dash-interface.git'

Any ideas on what could be causing the error?

Additional requirements

  • After I get the python application deployed, I still need to add a conda channel in order to install a specific package. How can I do this?
  • Some of the package requirements do not have a compatible version on conda, only PyPI (pip), does the use of a conda environment in heroku forfeit the ability to use pip?

UPDATE: I think I figured out the additional requirements, contents of my environment.yml:

name: openmc-dash-interface
channels:
    - conda-forge
dependencies:
- python=3.6
- anaconda
- openmc
- pip
- pip:
  - dash
  - plotly
  - dash-core-components
  - dash-html-components
  - dash-daq
  - numpy
  - pandas
  - gunicorn

But still getting errors at build

Thanks in advance for any/all help

like image 637
Sterling Butters Avatar asked Mar 10 '19 03:03

Sterling Butters


1 Answers

It appears Python3 is not supported with this buildpack: https://github.com/heroku-python/conda-buildpack/issues/14

However, other third-party buildpacks exist that appear to support Python3: https://elements.heroku.com/buildpacks/trib3/conda-buildpack https://elements.heroku.com/buildpacks/teamupstart/conda-buildpack

Maybe: https://github.com/pl31/heroku-buildpack-conda

like image 155
Sterling Butters Avatar answered Oct 14 '22 02:10

Sterling Butters