在Heroku Master上推送git时出现Cython错误 [英] Cython error when pushing git on heroku master

查看:80
本文介绍了在Heroku Master上推送git时出现Cython错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击命令 git push heroku master时出现这些错误。它告诉我必须安装Cython。我还使用 pip3 install cython进行了安装,但仍然显示错误。我也更改了我的requirements.txt文件。

I am getting these errors when I hit the command, "git push heroku master". It tells me that I have to install Cython. I had also installed using "pip3 install cython" but it still shows me an error. I have also changed my requirements.txt file too.

推荐答案

另一种解决方案如果您想使用 requirements.txt ,则可以尝试使用 bin / pre_compile 脚本。

Another solution here you can try is bin/pre_compile script if you want to use requirements.txt.

要跟踪buildpack bin / compile 脚本( https://github.com/heroku/heroku-buildpack-python/blob/master/bin/compile#L183-L189 ),您可以找到以下注释:

To trace the buildpack bin/compile script (https://github.com/heroku/heroku-buildpack-python/blob/master/bin/compile#L183-L189), you can find the comments:


这部分代码用于允许用户自定义其构建
通过提供
bin / pre_compile 脚本可以体验到无需分叉buildpack的脚本,该脚本会自动与buildpack
内联运行。

This part of the code is used to allow users to customize their build experience without forking the buildpack by providing a bin/pre_compile script, which gets run inline with the buildpack automatically.

然后在脚本中,您可以在执行 pip install

Then in the script, you can add a line to install cython before executing pip install

$BUILD_DIR/.heroku/python/bin/python -m pip install cython

$ BUILD_DIR 参数是此版本的构建环境,该版本中的所有设置都将保存在此处并部署到生产环境。

The $BUILD_DIR argument is the building environment of this build, all settings in this build will be saved here and deploy to production.

它适用于我的情况,对您也有用。

It works on my case, help it works for you too.

heroku之后-18堆栈,您需要使用与conda相关的机制来安装科学软件包。这是链接: https://devcenter.heroku.com/articles / python-pip#scientific-python-users

after heroku-18 stack, you need to use conda related mechanisms to install scientific packages. Here is the link: https://devcenter.heroku.com/articles/python-pip#scientific-python-users

这篇关于在Heroku Master上推送git时出现Cython错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆