When I run my app locally, everything works, but when I try to deploy to Heroku, I get this error:
ModuleNotFoundError: No module named 'stripe'
I've read some other answers to similar issues and it seems like maybe my virtual environment is running a different version of Python than the one on Heroku, or something along those lines?
My Python version is 3.6.5
I do have a runtime.txt file with the following in it, which I thought was setting the python version for my Heroku app:
python-3.6.5
I read this SO thread, but I didn't really understand the part about the PYTHONPATH - Importing Stripe into Django - NameError
If anyone can help steer me in the right direction or has an idea of what I could try, I'd really appreciate it!
Thanks!
Add stripe to requirements.txt file in the root of your repository. You can read more about it here.
Related
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.
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.
I'm an old-school developer, learning Django and GitHub for the first time. I'd like to study https://github.com/tomwalker/django_quiz, but when installed in my virtual environment, I can't find the file "manage.py". A YouTube Django tutorial suggested I need to run "py manage.py runserver" to start a web server on my local machine. (I was successful starting a server when following THAT tutorial, but I'm now studying source code from GitHub.) There's clearly a difference in age between the sample project on GitHub and my YT tutorial... Can someone please tell me if I'm going about the learning of Django correctly, and if I truly need manage.py to start a server? Thank you!
This is an installable app, not a full project. As the instructions show, you should create your own project with django-admin.py startproject, then install this app and add it to the INSTALLED_APPS setting.
Note, this looks like a pretty old library and may not be compatible with recent Django versions.
For the last couple of weeks I have programmed a flask server. I was adviced to use virtualenv to make sure that all my python dependencies are easily tracked. However, now I have deployed it on my test server and it gives me the following error:
from flask import Flask
ImportError: No module named flask
Which is about the first python module that I have installed. Is there something I am doing wrong here? Virtualenv should've taken care for this, right? How can I check for these kind of errors during development?
I've been struggling with Heroku for a little while and I can't quite seem to figure my problem out. I have a runtime.txt in the root directory of my Python project that I am trying to deploy to Heroku, yet Heroku cannot find it for some reason. Every time I try deploying the app (I just keep creating/deleting new apps on Heroku) it just sends me this message:
-----> No runtime.txt provided; assuming python-2.7.4.
It makes no sense because my runtime.txt is clearly in the same directory as my Procfile and requirements.txt yet it has no problem finding those.
For good measure, here is my runtime.txt:
python-3.3.2
My project is based in Python 3.3, so I can't just go with the default python-2.7.4.
This may be a weird special case, I couldn't find anybody else with my problem while Googling. Thanks in advance!
EDIT: For anyone who may have this problem in the future, a simple reboot fixed the problem for me. Don't know why I didn't try it earlier.