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?
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
Silly newb question, it seems I can't use git to install content I need in the Heroku console, but my app/bot is dependent on content I normally use that for. I know very little about how git and pip work, or the right terminology to ask a question like this, so bare with me!
I have a bot made with Tomer8007's Kik Bot API that I've embedded in Flask and want to deploy to Heroku. I've deployed Flask sites there before, they work like a charm, but because I import everything to Heroku via git using the Heroku CLI I can't import this one which is already using git.
I normally use these two commands to fetch and install the dependencies I need for that project:
git clone -b new https://github.com/tomer8007/kik-bot-api-unofficial
pip install ./kik-bot-api-unofficial
I tried manually downloading and installing the API without git, but then it throws this error when I tried to run it: "TypeError: Couldn't build proto file into descriptor pool: duplicate file name (google/protobuf/descriptor.proto)", wheras it works perfectly fine when I use the two above commands instead. (This is locally btw).
I also made an attempt to import to heroku before using those commands and instead using them in the heroku console, but it throws a bunch of errors when I try. I also can't import it after using those commands locally, because I already used git. (I'm not sure how that works though, that's why I'm here.)
Everything in procfile.txt, requirements.txt, runtime.txt, etc is fine, the only issue is getting the API for the Kik bot. I've no idea what's going haywire when I attempt to manually download it instead of using git clone, or what alternative options I have. Any pointers?
Apparently, the duplicate file name (google/protobuf/descriptor.proto) error was caused by a breaking change in the protobuf package in versions greater than 4.
This is now fixed, and should also work on Python 3.9+.
I am attempting to set-up a docker container with php-apache and python. This is primarily for a php web application. For part of the functionality I wrote a python script that is utilizing a python library which fulfills functionality that I couldn't find with php. Otherwise I'd have just tried to stick to php for everything. I run the python script with php's shell_exec command. Everything works in my local development environment; however, when I attempt to push to production problems arise. Anyways, I have been trying for hours (tons of research on the topic) and I cannot figure out how to get Python installed on the same Docker container as php-apache. Here is an example of a Dockerfile I've been using:
FROM python:3.7
RUN apt-get update
RUN apt-get install python3.7
COPY requirements.txt ./
RUN pip3 install -r requirements.txt
FROM php:7.4.13-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql
With this set-up I get "sh: 1: python: not found".
If I remove the last two lines (php-apache) the container keeps restarting continuously (though python is installed in this case). I've tried many other examples of dockerfiles for python and combined with php-apache none have worked.
I ended up going with the suggestion from #DavidMaze and setting up two separate containers, one for php:apache, and one for python. For the python container I built a simple flask application with endpoints that, when a GET request is made, run a specific python function. I used PHP curl to communicate with this flask api from the php:apache container.
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 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!