I need to run a python application on Heroku that uses Open Cv as in this question: Python web application with OpenCV in Heroku
Unfortunately, Heroku does not seem to be able to fetch this build pack. I always get the error:Fetching set buildpack BUILDPACK_URL=https://github.com/diogojc/heroku-buildpack-python-opencv-scipy.git#cedar14... failed
Any idea how I can attempt to fix this issue? It this build pack working for others?
I recently tried this build pack and while heroku was able to fetch it successfully, it did not unpack the opencv zip correctly for installation and I was unable to use it for my flask application.
Take a look at the Anaconda build pack here!
https://github.com/kennethreitz/conda-buildpack
This build pack allows you to specify a conda-requirements.txt file, which you can use to include opencv.
The steps I followed to deploy an opencv Heroku app were:
create a web app and link it to a heroku project
heroku buildpacks:add https://github.com/kennethreitz/conda-buildpack
add a file called "conda-requirements.txt" to the same directory as your web app and add "opencv" to the file.
deploy the app and check to make sure that heroku is giving you something like this in the output:
remote: # packages in environment at /app/.heroku/miniconda:
remote: #
remote: opencv 3.1.0 np112py27_1
if it doesn't work, check the heroku logs to make sure the problem is with the build pack. If you're only trying to get opencv to work, only use this anaconda build pack, don't add any other build packs. Hope that helps!
Related
i am trying to deploy a vercel based app using ci cd system, i add gitlabci yml file and using enviroment variable, while running i got the following error
it seems the error originated while trying to install the required dependencies but i cannot seem to think whats the problem
here is my requirements.txt
dj-database-url==1.0.0
Django==4.1.3
django-cors-headers==3.13.0
django-crispy-forms==1.14.0
django-environ==0.7.0
django-livereload-server==0.4
django-storages==1.13.1
django-widget-tweaks==1.4.12
djangorestframework==3.14.0
psycopg2-binary==2.9.1
sqlparse==0.4.3
i expect my app can be built smoothly
I made a package.json and added:
Heroku buildpacks:set heroku/python
It still fails when deploying. This is a python app so I don't know what is happening.
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
parse error: Invalid numeric literal at line 1, column 7
! Unable to parse package.json
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
For apps that do not have a buildpack explicitly set, Heroku tries to detect which buildpack to use in the following order:
Ruby
Node.js
Clojure
Python
...
Buildpack detection is based on the presence of certain files. In the case of the Node.js buildpack, it looks for a package.json in the root directory of the project. It looks like your app has such a file.
Your question isn't entirely clear, but I think you put this text inside your package.json:
Heroku buildpacks:set heroku/python
That is not valid, so the Node.js buildpack doesn't know what to do with it.
A package.json file is from the Node.js ecosystem, and it must have a specific set of keys and values. Unless your application also requires Node.js, you shouldn't have a package.json file at all. Assuming you don't need that file, delete it and commit its removal.
Your Python project will need one of the following:
requirements.txt
setup.py
Pipfile and Pipfile.lock
If you already have one of these, great. Just redeploy and Heroku should detect your app as a Python app.
If you don't have any of these, the easiest thing to do is to place an empty requirements.txt file in the root of your project. Make sure to commit it before deploying again.
If you wish to be explicit, you can run the command you tried to use before on the command line:
heroku buildpacks:set heroku/python
This shouldn't be necessary for a single-language app, though. Note that heroku is all lowercase.
I'm trying to update a Docker image on my Heroku app.
I just used the following commands from this documentation article: https://devcenter.heroku.com/articles/container-registry-and-runtime
heroku login
heroku container:login
heroku container:push web
heroku container:release web
heroku open
This set of commands worked perfectly the first time, except that I got an error about not being able to map to the $PORT variable I figured out how to fix the problem (I'm using Flask), so I updated my api.py (I named it api.py instead of app.py), and now I want to push the updates to the Heroku app. But running through those commands, it seems to use the cache (I've had this problem on my local machine before; I have to use the --no-cache option when I buid). I don't really know when it's being built on Heroku.
Anyways, at the end of the release command, it says: The process type web was not updated, because it is already running the specified docker image.
How do I get it to update?
Just for the people out there looking at this, it turned out it was a simple mistake in my Dockerfile.
Basically, I was using git clone to get my app files. Because of this, I had no ADD commands anywhere, so all the results were being cached by docker.
All I had to do was run ADD instead of git clone to import my project files, and now everything runs perfectly well :)
I am trying to deploy my Pyramid app on Heroku and no matter what I do, I get the failed to detect buildpack error message after I try to push.
I have my requirements.txt from my pip freeze in there next to my setup.py as well as my Procfile and runapp.py. I am not using my master branch for Heroku and have been using
git push heroku local_branch:master
I have also tried to set the build pack manually by using
heroku buildpacks:set heroku/python
I also have tried using external buildpacks from github, but that also does not work. I must be missing something in my requirements.txt?
Also, I have read Pyramid's Docs on Heroku deployment as well as Heroku's. I have browsed here for help but all I can find is that to make sure requirements.txt is spelled correctly or just re-init my git.
Add a "requirements.txt" file to the root directory of your repository.
In my flask app I often use abiword in a subprocess call. Now I am trying to migrate that application to heroku however I am running into some trouble when trying to get abiword installed
Following the approach on this website
http://theprogrammingbutler.com/blog/archives/2011/07/28/running-pdftotext-on-heroku/
does not seem to work because when I use ./configure I get the error that several packages were not found and I cant use apt-get on heroku to install them.
What can I do to create a full buildpack to add to my heroku buildpacks?