通过Anaconda部署到Heroku

编程入门 行业动态 更新时间:2024-10-27 23:25:04
本文介绍了通过Anaconda部署到Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

但是,我使用的是Anaconda,它在虚拟环境中表现不佳.有没有人在Heroku上部署了带有Anaconda的Django应用,并且可以引导我完成这些步骤?

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安装依赖项的部分,因为该部分与 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 setup with the default heroku python buildpack and my custom condas buildpack fork The 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

本文发布于:2023-10-28 02:12:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535204.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Anaconda   Heroku

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!