在Heroku中设置Python Conda环境

时间:2019-03-10 03:14:09

标签: python heroku pip anaconda conda

背景

我在这里使用conda环境的指南在项目目录中创建了一个heroku实例: conda-buildpack

错误

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'

关于什么可能导致错误的任何想法?

其他要求

  • 在部署python应用程序之后,我仍然需要添加一个conda通道才能安装特定的软件包。我该怎么办?
  • 某些软件包要求在conda上没有兼容版本,只有PyPI(pip),在heroku中使用conda环境会丧失使用pip的能力吗?

更新:我想我已经找出了其他要求,即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

但是在构建时仍然会出错

在此先感谢您提供所有帮助