简体   繁体   English

在Heroku Master上推送git时出现Cython错误

[英]Cython error when pushing git on heroku master

I am getting these errors when I hit the command, "git push heroku master". 按下命令“ git push heroku master”时出现这些错误。 It tells me that I have to install Cython. 它告诉我必须安装Cython。 I had also installed using "pip3 install cython" but it still shows me an error. 我还使用“ pip3 install cython”进行了安装,但仍然显示错误。 I have also changed my requirements.txt file too. 我也更改了我的requirements.txt文件。 在此处输入图片说明

Another solution here you can try is bin/pre_compile script if you want to use requirements.txt . 如果要使用requirements.txt可以在此处尝试的另一种解决方案是bin/pre_compile脚本。

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

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. 这部分代码用于允许用户通过提供bin/pre_compile脚本来自定义其构建体验,而无需分叉buildpack,该脚本会自动与buildpack内联运行。

Then in the script, you can add a line to install cython before executing pip install 然后在脚本中,您可以在执行pip install之前添加一行以安装cython

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

The $BUILD_DIR argument is the building environment of this build, all settings in this build will be saved here and deploy to production. $BUILD_DIR参数是此构建的构建环境,此构建中的所有设置都将保存在此处并部署到生产中。

It works on my case, help it works for you too. 它适用于我的情况,也可以帮助您。

update 更新

after heroku-18 stack, you need to use conda related mechanisms to install scientific packages. 在heroku-18堆栈之后,您需要使用与conda相关的机制来安装科学软件包。 Here is the link: https://devcenter.heroku.com/articles/python-pip#scientific-python-users 这是链接: https : //devcenter.heroku.com/articles/python-pip#scientific-python-users

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM