I am trying to deploy a Django program to Heroku. The application runs successfully on my local machine, which uses Anaconda and Python 3.5. I cannot get it to push to Heroku. Upon the command
>git push heroku master remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: ! Python has released a security update! Please consider upgrading to python-3.6.8 remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes remote: -----> Installing python-3.6.2 remote: -----> Installing pip remote: -----> Installing dependencies with Pipenv 2018.5.18… remote: Installing dependencies from Pipfile.lock (958efe)… remote: -----> Installing SQLite3 remote: -----> $ python manage.py collectstatic --noinput remote: Traceback (most recent call last): remote: File "manage.py", line 15, in <module> remote: execute_from_command_line(sys.argv) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line remote: utility.execute() remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute remote: django.setup() remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 24, in setup remote: apps.populate(settings.INSTALLED_APPS) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate remote: app_config = AppConfig.create(entry) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 90, in create remote: module = import_module(entry) remote: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module remote: return _bootstrap._gcd_import(name[level:], package, level) remote: File "<frozen importlib._bootstrap>", line 978, in _gcd_import remote: File "<frozen importlib._bootstrap>", line 961, in _find_and_load remote: File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked remote: ModuleNotFoundError: No module named 'requests' remote: remote: ! Error while running '$ python manage.py collectstatic --noinput'. remote: See traceback above for details. remote: remote: You may need to update application code to resolve this error. remote: Or, you can disable collectstatic for this application: remote: remote: $ heroku config:set DISABLE_COLLECTSTATIC=1 remote: remote: https://devcenter.heroku.com/articles/django-assets remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to [redacted].
I'm not sure why I can't get the
requests
module to bepip
installed in Heroku. It is in myrequirements.txt
file:Django==2.1.7 dj-database-url==0.5.0 dj-static==0.0.6 gunicorn==19.9.0 Unipath==1.1 python-decouple==3.1 Pillow==3.3.0 Markdown==3.0.1 bleach==3.1.0 psycopg2==2.7.7 whitenoise==4.1.2 requests==2.21.0 requests-oauthlib==1.0.0
score:6
The output from your Heroku build shows that you have a Pipfile
and Pipfile.lock
in addition to your requirements.txt
.
You need to choose between using pip
(using requirements.txt
) or Pipenv (using Pipfile
and Pipfile.lock
). If all three files are present, Heroku will install with Pipenv, ignoring your requirements.txt
file.
Either
- move your requirements to your
Pipfile
and run Pipenv locally to install them and update yourPipfile.lock
, delete yourrequirements.txt
, commit, and push (to use Pipenv), or - delete the
Pipfile
andPipfile.lock
, usepip
(orpip-tools
or similar) locally, commit, and push (to usepip
).
Credit To: stackoverflow.com
Related Query
- Heroku - No module named wsgi
- ModuleNotFoundError - No module named 'main' when attempting to start service
- Django & Heroku - ImportError: No module named gettingstarted.wsgi
- Heroku push of django app gets "No module named psycopg2.extensions"
- Django Heroku - ModuleNotFoundError: No module named 'django_heroku'
- ImportError: No module named 'decouple' while deploying on Heroku
- Django / Heroku ModuleNotFoundError: No module named 'MyProject.apps'
- heroku procfile problem : ModuleNotFoundError: No module named 'myApp.wsgi'
- heroku django import error no module named _collections
- ModuleNotFoundError : no module named : crispy_forms
- Heroku Deployment : ModuleNotFoundError: No module named 'django_summernote'
- Can't deploy to heroku - No module named
- Heroku: ModuleNotFoundError :No module named 'requests'
- Heroku Python Django App Deployment Failure: No module named 'oauth2_provider'
- Django: No module named 'psycopg2' when launching migrations to heroku
- Heroku app: ModuleNotFoundError: No module named 'pwa'
- ModuleNotFoundError: No module named 'useracc' When deploying to heroku
- heroku No module named _sqlite3
- heroku errors ImportError: No module named crispy_forms
- ModuleNotFoundError: No module named '_tkinter' Heroku
- ModuleNotFoundError: No module named 'jinja2' during deployment of django project on heroku
- pip install error: ModuleNotFoundError No module named 'setuptools'
- Heroku 403 Forbidden Error while using Python requests module
- Django Heroku no module named 'my app name'
- Heroku deployment: ModuleNotFoundError: No module named 'django'
- python crash course heroku ModuleNotFoundError: No module named 'bootstrap4'
- ModuleNotFoundError: No module named 'App Name' when using Django and Gunicorn on a heroku server
- django error: ModuleNotFoundError No module named 'siteerrors'
- No module named pkg_resources
- No module named MySQLdb
More Query from same tag
- If page is unpublished go to the next available page
- Django DateTimeField default
- Django user.is_staff not working
- Django Rest Framework Tests HyperlinkedRelatedField
- how to hide django message after it is displayed for few seconds
- installing Django's mysql module
- IntegrityError: FOREIGN KEY constraint failed in django
- How to select many to one to many without hundreds of queries using Django ORM?
- How to fix 'str' object is not a mapping error
- jquery and css rendering different based in the same browser window based on whether loaded via django or statically
- Use the Django ORM in a standalone script (again)
- Is it good practice to do file versioning on .mo i18n files?
- How to fix "MultiValueDictKeyError at /accounts/logout"
- Django - Can't import ListView and DetailView classes
- Same models appearing in conflicting models error