本文介绍了使用 Anaconda 部署到 Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个想要部署到 Heroku 的 Django 应用程序.我尝试按照此处的说明进行操作:https://devcenter.heroku.com/articles/getting-started-with-django它告诉你使用虚拟环境.

I have a Django app I want to deploy to Heroku. I tried to follow the instructions here: https://devcenter.heroku.com/articles/getting-started-with-djangowhich tells you to use virtual env.

但是,我使用的是 Anaconda,它不能很好地与虚拟环境配合使用.有没有人将带有 Anaconda 的 Django 应用程序部署到 Heroku 并且可以指导我完成这些步骤?

However, I'm using Anaconda, which isn't playing nicely with virtual env. Has anyone deployed a Django app with Anaconda to Heroku and can lead me through the steps?

推荐答案

我也遇到了这个问题.我想部署一个使用 numpy、sckit-learn 和其他一些 conda 包的 django 应用程序.我使用了 conda-buildpack 但无法从 django 内部访问已安装的软件包.所以我创建了一个扩展 PYTHONPATH 的分支,并删除了使用 pip install -r requirements.txt 安装依赖项的部分,因为这部分与 memcached on heroku.现在我有一个 多个 buildpack 设置使用默认的 heroku python buildpack我的自定义 condas buildpack 分支requirements.txt 由 python buildpack 处理,conda-requirements.txt 由 conda buildpack 处理.对我来说就像一个魅力.

I had this problem too.I wanted to deploy a django app which use numpy, sckit-learn and some other conda packages.I used the conda-buildpack but the installed packages weren't accessible from inside django. So I created a fork which extended the PYTHONPATH and removed the part where dependencies installed withpip install -r requirements.txt because this part clashed with memcached on heroku.Now I have a multiple buildpack setupwith the default heroku python buildpack and my custom condas buildpack forkThe requirements.txt is processed by the python buildpack and the conda-requirements.txt by the conda buildpack. Works like a charm for me.

这篇关于使用 Anaconda 部署到 Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 14:19
查看更多