heroku keeps installing django packages during each deployment - python

Im using django 3 and Python 3.7.4
I don't have any issues with the deployment and the project is working, it's just the first time I face this issue.
Normally when deploying to Heroku all packages in the requirements file get installed during the first deployment process, and any further deployment will only update or install the new packages the get added.
In my case, everytime I deploy, heroku is installing the whole packages again.
Please advise if there is a way to handle this issue.
thanks

This looks like a current issue with the Heroku python buildpack. As long as the issue persists the cache is cleared on every build, since the sqlite3 check is broken. Suggest upvoting the issue on GitHub.

Related

How can you change your python code after you deploy it to heroku using git , without downloading and reinstalling requirements everytime? [duplicate]

Im using django 3 and Python 3.7.4
I don't have any issues with the deployment and the project is working, it's just the first time I face this issue.
Normally when deploying to Heroku all packages in the requirements file get installed during the first deployment process, and any further deployment will only update or install the new packages the get added.
In my case, everytime I deploy, heroku is installing the whole packages again.
Please advise if there is a way to handle this issue.
thanks
This looks like a current issue with the Heroku python buildpack. As long as the issue persists the cache is cleared on every build, since the sqlite3 check is broken. Suggest upvoting the issue on GitHub.

Heroku won't run latest python file

I use Heroku to host my discord.py bot, and since I've started using sublime merge to push to GitHub (I use Heroku GitHub for it), Heroku hasn't been running the latest file. The newest release is on GitHub, but Heroku runs an older version. I don't think it's anything to do with sublime merge, but it might be. I've already tried making a new application, but same problem. Anyone know how to fix this?
Edit: I also tried running Heroku bash and running the python file again
1) Try to deploy branch (maybe another branch)
2) Enable automatic deploy

Deploying my Python app to Heroku breaks Heroku's Python interpreter

This is an old app, running since about two years on Heroku. Now suddenly, when I deploy (standard git push), it breaks the Python interpreter, both on regular and one-off dynos. Here's what it looks like:
$ heroku run python
Running `python` attached to terminal... up, run.8338
python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
Further pushes, heroku restart, scaling the dynos to zero and back up, that all doesn't fix it.
The only changes contained in this deployment which I could imagine being related to this problem are: gevent upgraded from 0.13.6 to 1.0.1 and the introduction of a runtime.txt (before there was none, resulting in 2.7.4, now there's one for 2.7.6).
I rolled all of this back to no effect, however. In fact, I went back about 30 commits (the deployment contained maybe five) and pushed that and the app is still broken.
Rolling back with heroku rollback is the only way I've found to take the app back into a usable state. But of course that doesn't help me going forward.
What might cause this? Can I somehow rebuild my whole app environment from scratch?
EDIT 1: I opened a shell in a one-off dyno and I can see the libpython2.7.so.1.0 file there:
/ $ ls -la /app/.heroku/python/lib/libpython2.7.so.1.0
-r-x------ 1 u49295 49295 5694572 2014-06-03 23:39 /app/.heroku/python/lib/libpython2.7.so.1.0
Of course I don't know if that's where it's supposed to be.
Somehow certain apps did not upgrade properly. A temporary fix to locate the correct python library:
heroku config:set LD_LIBRARY_PATH=/app/.heroku/python/lib
Kenneth Reitz from the Python team here.
So, we're rolling out security updates to the version of Python that we have installed on our base system. Customers shouldn't be affected by this in any way, because their apps use their own version of Python, and because we set local runtime-specific (such as LD_LIBRARY_PATH) in a .profile.d scripts, outside of user-set configuration.
However, we allow power users to override these environment variables with $ heroku config. That's basically what the application was doing — although, not knowingly. This was an accidental side-effect of a much, much older Heroku. In older days, we couldn't have any runtime-specific configuration without being a part of user configuration. This is why your application had an LD_LIBRARY_PATH config set, and this is what caused this bug.
Because of this, I've disabled the overridability of LD_LIBRARY_PATH for Python apps, and all should be well moving forward.
Thanks for being a part of the gradual rollout process, and thanks for helping us get to the bottom of this regression. I'm very sorry for the inconvenience.
Are you using the default Python buildpack? Heroku is in the process of updating the Stack image, and especially if you're not using a current buildpack, there may be incompatibilities.
To see if you're using a default buildpack, run
$ heroku config | grep BUILDPACK_URL
Please contact Heroku support if you think this might be the cause.

django-templated-email doen't works on heroku

I've installed succesfully https://github.com/bradwhittington/django-templated-email.git, and it works smoothly on my local server, but, when I upload my app to a heroku repo that I have, when it get's to the sending email, the browser shows internal server error.
I think this is because it tries to read code from where "pip" installed the package, and that data path doesn't exists on heroku.
What I need to know:
How can I make it to work in my heroku server?
Thanks a lot!
Have you specified the below in your requirements.txt file for pip to know where to install it from?
The below points to the latest commit. If the developer has packaged the file as a egg, you can use that too.
git+git://github.com/bradwhittington/django-templated-email.git/62a291004cb21e50409b276bcbd79ae9808aace9
So if the missing package is the reason for your error, adding the above to requirements.txt should fix it

How do I setup a local Django development environment on Ubuntu?

Finally made the switch from Windows to Linux (Ubuntu). I am teaching myself Python + Django.
GOAL: I want to setup a local development environment where I can build a django application and run it locally before deploying it live online.
SO FAR: Python comes installed with Linux. Gedit does also. Ok great. After that I am lost.
I am not sure how to proceed. I am a total Linux noob. I am guessing I need apache running, mysql running, and django to run. I don't know how to setup these things to run or how to set the proper directories or what I need to link to what... really I am not even sure what the right questions are to ask.
Quick answer:
Just install django via their documentation, and you will not even need apache running as it will run its own server. You can use sqlite as a db and you won't even have to worry about mysql. This is if your goal is to learn django and get things running asap.
Otherwise, if you want to take the full route, you'll need to start learning a lot more (which isn't a bad thing). I'd say take a look at some of the slicehost guides for setting up apache, mysql in ubuntu:
http://articles.slicehost.com/2010/5/19/installing-apache-on-ubuntu
http://articles.slicehost.com/2011/3/10/installing-mysql-server-on-ubuntu
And then pick up with just installing django and going from there. The django tutorial is awesome. There's plenty of other documentation out there on the web & tutorials for setting up dev environments.
Assuming you have python
You can install pip:
easy_install pip
From now you can use pip to install your python libraries for example to install django
pip install django
For development I would prefer pydev, it has a support for django with the power of eclipse.

Categories