I am getting this error while pushing the Django project to Heroku master. I am new to Django. Any help will be really appreciated.
-----> Installing dependencies using Pip (1.2.1)
Downloading/unpacking Brlapi==0.5.5 (from -r requirements.txt (line 1))
Could not find any downloads that satisfy the requirement Brlapi==0.5.5 (from -r requirements.txt (line 1))
No distributions at all found for Brlapi==0.5.5 (from -r requirements.txt (line 1))
Storing complete log in /app/.pip/pip.log
! Heroku push rejected, failed to compile Python app
To git#heroku.com:enigmatic-plateau-3620.git
! [remote rejected] master -> master (pre-receive hook declined)
Use the --no-site-packages option to prevent the virtual environment from having access to all the packages on your system.
virtualenv --no-site-packages venv
If you don't need the Brlapi for your Django app, try removing the Brlapi==0.5.5 line from your requirements.txt document. Then, commit the change:
git add requirements.txt
git commit
git push heroku master
Related
When I deploy app in heroku show me this error
remote: ERROR: Could not find a version that satisfies the requirement apturl==0.5.2 (from -r /tmp/build_16067d5dbf345d8d906970e4d4f44d30/requirements.txt
I searched on internet to finding the solution of that problem but can't successfully find this.
So I show you what steps I had do for deploy app in heroku
I typed in terminal
heroku login
pip3 freeze
pip3 freeze > requirements.txt
Then for instaling gunicorn type in terminal
pip3 install gunicorn
Then make a file in root directory write name is Procifle in which I write
web: gunicorn django_project.wsgi
Then my heroku blog name
heroku git:remote -a naqviblog
I also show you my requirements.txt file
apturl==0.5.2
asgiref==3.2.3
asn1crypto==0.24.0
blinker==1.4
boto3==1.9.96
botocore==1.12.96
Brlapi==0.6.7
certifi==2018.8.24
chardet==3.0.4
command-not-found==0.3
cryptography==2.3
cupshelpers==1.0
defer==1.0.6
distro==1.3.0
distro-info===0.21ubuntu2
dj-database-url==0.5.0
Django==3.0.4
django-crispy-forms==1.9.0
django-heroku==0.3.1
django-storages==1.7.1
docutils==0.14
entrypoints==0.3
f.lux-indicator-applet==1.1.11rc0
galternatives==1.0.3
gunicorn==20.0.4
httplib2==0.11.3
idna==2.6
jmespath==0.9.3
keyring==17.1.1
keyrings.alt==3.1.1
language-selector==0.1
launchpadlib==1.10.6
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
lightdm-gtk-greeter-settings==1.2.2
louis==3.8.0
macaroonbakery==1.2.1
Mako==1.0.7
MarkupSafe==1.1.0
netifaces==0.10.4
oauth==1.0.1
oauthlib==2.1.0
olefile==0.46
pbr==5.4.4
pexpect==4.6.0
Pillow==5.4.1
protobuf==3.6.1
psycopg2==2.7.7
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
PyGObject==3.32.0
PyJWT==1.7.0
pymacaroons==0.13.0
PyNaCl==1.3.0
pyOpenSSL==19.0.0
pyRFC3339==1.1
python-apt===1.8.5-ubuntu0.3
python-dateutil==2.7.3
python-debian==0.1.34
python-decouple==3.3
pytz==2018.9
pyxattr==0.6.1
pyxdg==0.25
PyYAML==3.13
reportlab==3.5.18
requests==2.21.0
requests-unixsocket==0.1.5
s3transfer==0.2.0
SecretStorage==2.3.1
simplejson==3.16.0
six==1.12.0
sqlparse==0.3.1
system-service==0.3
systemd-python==234
testresources==2.0.1
ubuntu-advantage-tools==19.2
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
urllib3==1.24.1
usb-creator==0.3.3
virtualenv==15.1.0
wadllib==1.3.3
whitenoise==4.1.2
xkit==0.0.0
youtube-dl==2019.1.17
zope.interface==4.3.2
Then type in terminal
git add .
git commit -m "commit changes"
finally type
git push heroku master
then showed me this error
Enumerating objects: 77, done.
Counting objects: 100% (77/77), done.
Delta compression using up to 4 threads
Compressing objects: 100% (60/60), done.
Writing objects: 100% (67/67), 3.72 MiB | 421.00 KiB/s, done.
Total 67 (delta 21), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Clearing cached dependencies
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote: ERROR: Could not find a version that satisfies the requirement apturl==0.5.2 (from -r /tmp/build_d533b9574fcab74e6906cdc8732269b2/requirements.txt (line 1)) (from versions: none)
remote: ERROR: No matching distribution found for apturl==0.5.2 (from -r /tmp/build_d533b9574fcab74e6906cdc8732269b2/requirements.txt (line 1))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to naqviblog.
remote:
To https://git.heroku.com/naqviblog.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/naqviblog.git'
when open this link https://git.heroku.com/naqviblog.git
then show me on browser
Method Not Allowed
That's a lot of packages. Are you sure your project requires them all?
You added the python-3.7 tag but Heroku says it is using python 3.6. Ensure that both developing and production environment match.
apturl does not exist on PyPI https://pypi.org/. When you run python -m pip install packagename you search for it on PyPI. It does not exist on there. You may have installed it through apt, setup.py, wheels, etc.
There are a few posts with this particular issue however I've tried about five or six different suggestions from those posts and have had no luck.
When trying
git push heroku master
I get the following error:
(env) PS C:\Users\Shaun\Desktop\DjangoBlog\src> git push heroku master
Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to murmuring-dusk-96030.
remote:
To https://git.heroku.com/murmuring-dusk-96030.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/murmuring-dusk-96030.git'
From the build log on the Heroku website:
-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed
I have a simple static website running Django 2.2.3 as back end. I've been developing in a virtual environment on my local machine and have the following project structure shown blow, where src/ was what I renamed the folder created by the django-admin startproject command.
I'd like to deploy my site on Heroku so I've signed up, installed Git and the Heroku CLI. In my terminal I've logged in to Heroku and initialized my Git repository in this top level root (src/). I've added a Procfile which contains the following:
web: gunicorn blog.wsgi --log-file -
I have the following in my runtime.txt file. I'm actually running 3.7.3 in my virtual environment but I've tried both ways:
python-3.6.1
To settings I added:
import django_heroku
MIDDLEWARE = [
# added this:
'whitenoise.middleware.WhiteNoiseMiddleware',
]
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# Add configuration for static files storage using whitenoise
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
django_heroku.settings(locals())
My requirements.txt contains all packages I'm using and psycopg2, whitenoise and gunicorn, django-heroku.
I'm not sure what I'm doing wrong exactly, any help would be appreciated.
Your requirements.txt, along with your Procfile and runtime.txt, must be in the top-level root directory of your project.
Move them there, commit that change, and deploy again, e.g.
cd $PROJECT_ROOT
git mv src/requirements.txt .
git mv src/Procfile .
git mv src/runtime.txt .
git commit -m 'Move requirements.txt and Heroku files to root'
git push heroku master
I've got two Heroku apps, running on the same codebase. The 1st is used as staging env and it works as expected (it auto deploys the devel branch) and the 2nd is used as the production app (auto deploying the master branch).
Today I did a minor code-level change and submitted a PR from devel to master and merged it. From that moment, heroku cannot deploy my master branch in production.
Full logs for this as given by heroku build log:
----->
Python app detected
-----> Uninstalling stale dependencies
Uninstalling django-elasticsearch-0.5:
Successfully uninstalled django-elasticsearch-0.5
Uninstalling pymongo-3.3.0:
Successfully uninstalled pymongo-3.3.0
$ pip install -r requirements.txt
Collecting git+https://github.com/liberation/django_elasticsearch.git (from -r requirements.txt (line 69))
Cloning https://github.com/liberation/django_elasticsearch.git to /tmp/pip-ZPaLWp-build
Collecting Delorean==0.6.0 (from -r requirements.txt (line 10))
Downloading Delorean-0.6.0.tar.gz
Collecting humanize==0.5.1 (from -r requirements.txt (line 37))
Downloading humanize-0.5.1.tar.gz
Collecting pynamodb==2.0.2 (from -r requirements.txt (line 46))
Downloading pynamodb-2.0.2-py2.py3-none-any.whl (73kB)
Collecting tzlocal==1.3 (from -r requirements.txt (line 63))
Downloading tzlocal-1.3.tar.gz
Installing collected packages: humanize, tzlocal, Delorean, django-traffic, pynamodb, django-elasticsearch
Running setup.py install for humanize: started
Running setup.py install for humanize: finished with status 'done'
Running setup.py install for tzlocal: started
Running setup.py install for tzlocal: finished with status 'done'
Running setup.py install for Delorean: started
Running setup.py install for Delorean: finished with status 'done'
Running setup.py install for django-elasticsearch: started
Running setup.py install for django-elasticsearch: finished with status 'done'
Successfully installed Delorean-0.6.0 django-elasticsearch-0.5 django-traffic-1.2.4 humanize-0.5.1 pynamodb-2.0.2 tzlocal-1.3
-----> Django app detected
-----> Running Django migrations
ImportError: No module named site
! Push rejected, failed to compile Django app.
! Push failed
Well, as fas as I know, there's no "site" module/app or anything in my code, so I cannot understand what's the problem in this case. I remind you, the devel branch auto deploys as expected in the respective Heroku app.
Any ideas?
I'm trying to push my django app in heroku and I've followed all the instructions in the tutorial of heroku's page, but when i try to do the push i get this:
christian#christian-R480-R431-R481:~/Documentos/heroku/Portafolio6$ sudo git push heroku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 542 bytes, done.
Total 5 (delta 0), reused 0 (delta 0)
! Push rejected, no Cedar-supported app detected
To git#heroku.com:mysterious-thicket-1865.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:mysterious-thicket-1865.git'
christian#christian-R480-R431-R481:~/Documentos/heroku/Portafolio6$
I dont know why this happens. Do I have to do the push in the django project or when i have the virtualenv folder?
Do you have a valid requirements.txt file? This file is needed by Heroku to pip install the relevant python packages that your app uses.
To auto generate this file, just run the following code:
pip freeze > requirements.txt
The requirements.txt file should reside at the top most level, adjacent to the app.
The 'Step 3 - Heroku Best Practices' section at http://www.deploydjango.com/django_project_structure/ will give you more info.
Check that you have the requirements.txt, Procfile and runtime.txt files in your directory.
To generate requirements.txt, activate your virtualenv and freeze the installed packages:
workon my_project
pip freeze > requirements.txt
Your Procfile is responsible for telling the heroku system how to run your app (and most likely is what is missing in this instance). Here is a sample:
web: gunicorn my_project.wsgi -b 0.0.0.0:$PORT
Your runtime.txt file is responsible for determining which version of python to run:
python-2.7.4
Ensure that all three files exist (technically runtime.txt is optional, but it's a good idea), are commited and then try your push again.
I have an issue while trying to deploy my Django app to Heroku.
It complains about issues with installing facebook-sdk library, but actually there is
no such thing in the requirements.txt file.
I already tried pushing with -f flag, I commented out lines from requirements.txt. I've even pushed an empty requirements file and the issues still persist.
I have no idea if there is any way to reset the app or heroku's repo beside creating a new one? Any ideas what I could try?
Console log:
$ git push prod master
Counting objects: 52282, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (17957/17957), done.
Writing objects: 100% (52282/52282), 138.01 MiB | 137 KiB/s, done.
Total 52282 (delta 33410), reused 48501 (delta 30768)
-----> Heroku receiving push
-----> Python/Django app detected
-----> Preparing Python interpreter (2.7.2)
-----> Creating Virtualenv version 1.7
New python executable in .heroku/venv/bin/python2.7
Also creating executable in .heroku/venv/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
Running virtualenv with interpreter /usr/local/bin/python2.7
-----> Activating virtualenv
-----> Installing dependencies using pip version 1.0.2
error: The requested URL returned error: 401 while accessing http://github.com/facebook/python-sdk.git/info/refs
fatal: HTTP request failed
Downloading/unpacking paramiko (from -r requirements.txt (line 17))
Creating supposed download cache at /app/tmp/repo.git/.cache/pip_downloads
Storing download in cache at /app/tmp/repo.git/.cache/pip_downloads/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fp%2Fparamiko%2Fparamiko-1.7.7.2.zip
Running setup.py egg_info for package paramiko
Obtaining facebook-sdk from git+http://github.com/facebook/python-sdk.git#egg=facebook-sdk (from -r requirements.txt (line 23))
Cloning http://github.com/facebook/python-sdk.git to ./.heroku/src/facebook-sdk
Complete output from command /usr/bin/git clone -q http://github.com/facebook/python-sdk.git /tmp/build_1bn5oykhrmms7/.heroku/src/facebook-sdk:
----------------------------------------
Command /usr/bin/git clone -q http://github.com/facebook/python-sdk.git /tmp/build_1bn5oykhrmms7/.heroku/src/facebook-sdk failed with error code 128
Storing complete log in /app/.pip/pip.log
! Heroku push rejected, failed to compile Python/django app
The right solution is "Maxime R."'s solution on how to pip uninstall with virtualenv on heroku cedar stack?
heroku labs:enable user_env_compile heroku config:add
CLEAN_VIRTUALENV=true
Currently this won't work because there is a bug. You'll need to use
my fork of the buildpack until this get fixed upstream :
heroku config:add
BUILDPACK_URL=git#github.com:blaze33/heroku-buildpack-python.git
Now push your new code and you'll notice that the whole virtualenv
gets reinstalled.
Andrey's answer no longer works since March 23 2012. The new style
virtualenv commit moved the virtual env from /app to /app/.heroku/venv
but the purge branch wasn't updated to catch up so that you end up
with a virtualenv not being in PYTHONHOME.
After several attempts with heroku run command finally I applied Maxime R. solution successfully. Also I have been opened a Heroku ticket and Heroku support has been confirmed to me that this is the solution.
It's happen because you're using an empty repository for python-SDK's library (http://github.com/facebook/python-sdk.git), try using another repo: https://github.com/pythonforfacebook/facebook-sdk
I had removed two packages from the virtual env and requirements.txt, and temporarily changing the Python runtime (as suggested here) is the only approach I found that allowed me to uninstall those packages from heroku.