When the application is deployed after git push to openshift repo I get an error when requirements.txt is start to installing.
The thing is, in my local machine there is not issue when I execute pip install cffi
remote: Requirement already satisfied (use --upgrade to upgrade): aniso8601==0.92 in /var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 1))
remote: Downloading/unpacking apns-client==0.2.1 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 2))
remote: Downloading apns-client-0.2.1.tar.gz
remote: Running setup.py egg_info for package apns-client
remote:
remote: Downloading/unpacking cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3))
remote: Could not find a version that satisfies the requirement cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3)) (from versions: 0.1, 0.2.1, 0.2, 0.3, 0.4.1, 0.4.2, 0.4, 0.5, 0.6, 0.7.1, 0.7.2, 0.7, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.8.5, 0.8.6, 0.8)
remote: Cleaning up...
remote: No distributions matching the version for cffi==0.9.2 (from -r /var/lib/openshift/myuser/app-root/runtime/repo/requirements.txt (line 3))
remote: Traceback (most recent call last):
remote: File "/var/lib/openshift/myuser/python/virtenv/bin/pip", line 12, in <module>
remote: load_entry_point('pip==1.4', 'console_scripts', 'pip')()
remote: File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 147, in main
remote: return command.main(args[1:], options)
remote: File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 171, in main
remote: log_fp = open_logfile(log_fn, 'w')
remote: File "/var/lib/openshift/myuser/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 200, in open_logfile
remote: os.makedirs(dirname)
remote: File "/var/lib/openshift/myuser/python/virtenv/lib64/python2.7/os.py", line 157, in makedirs
remote: mkdir(name, mode)
remote: OSError: [Errno 13] Permission denied: '/var/lib/openshift/myuser/.pip'
The same thing happens with pip isntall cryptography and pyOpenSSL
I finally fix it.
Connecting through ssh
rhc ssh -a myapp
Once I have connected I used pip as usual
pip install cffi
pip install cryptography
pip install pyOpenSSL
Related
I was trying to push what i have in my app using Django python to be deployed to Heroku and keep getting this error :
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/immense-brushlands'
requriment.txt file is there :
asgiref==3.4.1
beautifulsoup4==4.10.0
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.7
cloudinary==1.26.0
cryptography==35.0.0
defusedxml==0.7.1
Deprecated==1.2.13
dj-database-url==0.5.0
Django==3.2.5
django-bootstrap4==3.0.1
django-braces==1.14.0
django-heroku==0.3.1
django-oauth-toolkit==1.5.0
django-rest-framework-social-oauth2==1.1.0
djangorestframework==3.12.4
gunicorn==20.1.0
idna==3.3
jwcrypto==1.0
oauthlib==3.1.1
psycopg2==2.9.1
pycparser==2.20
PyJWT==2.3.0
python3-openid==3.2.0
pytz==2021.3
requests==2.26.0
requests-oauthlib==1.3.0
six==1.16.0
social-auth-app-django==5.0.0
social-auth-core==4.1.0
soupsieve==2.2.1
sqlparse==0.4.2
stripe==2.59.0
urllib3==1.26.7
whitenoise==5.3.0
wrapt==1.13.2
my Procfile in root directory and contain:
web : gunicorn foodhub.wsgi
I was trying to push what i have in my app using Django python to be deployed to Heroku and keep getting this error :
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/immense-brushlands'`
-----> Building on the Heroku-22 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.10.7
To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.10.7
-----> Installing pip 22.2.2, setuptools 63.4.3 and wheel 0.37.1
-----> Installing SQLite3
-----> Installing requirements with pip
Collecting asgiref==3.5.2
Downloading asgiref-3.5.2-py3-none-any.whl (22 kB)
Collecting certifi==2022.9.24
Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
Collecting cloudinary==1.26.0
Downloading cloudinary-1.26.0.tar.gz (170 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting dj-database-url==1.0.0
Downloading dj_database_url-1.0.0-py3-none-any.whl (6.6 kB)
Collecting Django==4.1.2
Downloading Django-4.1.2-py3-none-any.whl (8.1 MB)
Collecting django-heroku==0.3.1
Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
Collecting gunicorn==20.1.0
Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
Collecting psycopg2==2.9.4
Downloading psycopg2-2.9.4.tar.gz (384 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting six==1.16.0
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting sqlparse==0.4.3
Downloading sqlparse-0.4.3-py3-none-any.whl (42 kB)
Collecting tzdata==2022.4
Downloading tzdata-2022.4-py2.py3-none-any.whl (336 kB)
Collecting urllib3==1.26.12
Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
Collecting whitenoise==6.2.0
Downloading whitenoise-6.2.0-py3-none-any.whl (19 kB)
Building wheels for collected packages: cloudinary, psycopg2
Building wheel for cloudinary (setup.py): started
Building wheel for cloudinary (setup.py): finished with status 'done'
Created wheel for cloudinary: filename=cloudinary-1.26.0-py3-none-any.whl size=134187 sha256=391663ac9f9caa29fca028ee944bf59a6ac5066a9aa1012fb188ff52dac36979
Stored in directory: /tmp/pip-ephem-wheel-cache-odd2a9t_/wheels/58/0d/32/997fc6c26f83c9ae73a1bcd41028973512175982df608523ef
Building wheel for psycopg2 (setup.py): started
Building wheel for psycopg2 (setup.py): finished with status 'done'
Created wheel for psycopg2: filename=psycopg2-2.9.4-cp310-cp310-linux_x86_64.whl size=159965 sha256=cae6fb7d596d71258bdd30d91a0aa6ec5e8d5ba26d5c2c8f9601e00eb569ea53
Stored in directory: /tmp/pip-ephem-wheel-cache-odd2a9t_/wheels/10/07/ca/a5e7863aeec605e8a19ea9ccc90bb594784c287cc5534bbecb
Successfully built cloudinary psycopg2
Installing collected packages: whitenoise, urllib3, tzdata, sqlparse, six, psycopg2, gunicorn, certifi, asgiref, Django, cloudinary, dj-database-url, django-heroku
Successfully installed Django-4.1.2 asgiref-3.5.2 certifi-2022.9.24 cloudinary-1.26.0 dj-database-url-1.0.0 django-heroku-0.3.1 gunicorn-20.1.0 psycopg2-2.9.4 six-1.16.0 sqlparse-0.4.3 tzdata-2022.4 urllib3-1.26.12 whitenoise-6.2.0
-----> $ python manage.py collectstatic --noinput
Post-processing 'js/canvas-to-blob.min.js' failed!
Traceback (most recent call last):
File "/tmp/build_b3caaaea/manage.py", line 22, in <module>
main()
File "/tmp/build_b3caaaea/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
collected = self.collect()
File "/app/.heroku/python/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 154, in collect
raise processed
whitenoise.storage.MissingFileError: The file 'js/canvas-to-blob.min.js.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7ff53e881d50>.
The JS file 'js/canvas-to-blob.min.js' references a file which could not be found:
js/canvas-to-blob.min.js.map
Please check the URL references in this JS file, particularly any
relative paths which might be pointing to the wrong location.
! Error while running '$ python manage.py collectstatic --noinput'.
See traceback above for details.
You may need to update application code to resolve this error.
Or, you can disable collectstatic for this application:
$ heroku config:set DISABLE_COLLECTSTATIC=1
https://devcenter.heroku.com/articles/django-assets
****** Collectstatic environment variables:
PYTHONUNBUFFERED=1
PKG_CONFIG_PATH=/app/.heroku/vendor/lib/pkg-config:/app/.heroku/python/lib/pkg-config:
DEBUG_COLLECTSTATIC=1
BPLOG_PREFIX=buildpack.python
PWD=/tmp/build_b3caaaea
HOME=/app
LANG=en_US.UTF-8
SOURCE_VERSION=495ce7e183efedd2df883a898d49dab71e966050
REQUEST_ID=9bd57211-cb18-3350-055d-aa2d6bfe888e
ENV_DIR=/tmp/d20221008-54-7rg3a6
PYTHONPATH=.
CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:/app/.heroku/python/include:
BIN_DIR=/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin
LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:
SHLVL=1
LD_LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:
PIP_NO_PYTHON_VERSION_WARNING=1
BUILDPACK_LOG_FILE=/dev/null
STACK=heroku-22
BUILD_DIR=/tmp/build_b3caaaea
CACHE_DIR=/tmp/codon/tmp/cache
PATH=/app/.heroku/python/bin:/app/.heroku/vendor/bin::/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/vendor/
EXPORT_PATH=/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin/../export
C_INCLUDE_PATH=/app/.heroku/vendor/include:/app/.heroku/python/include:
DYNO=run.5378
PROFILE_PATH=/tmp/build_b3caaaea/.profile.d/python.sh
OLDPWD=/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136
_=/usr/bin/env
! Push rejected, failed to compile Python app.
! Push failed
remote: Collecting tzdata==2022.4
remote: Downloading tzdata-2022.4-py2.py3-none-any.whl (336 kB)
remote: Collecting urllib3==1.26.12
remote: Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
remote: Collecting whitenoise==6.2.0
remote: Downloading whitenoise-6.2.0-py3-none-any.whl (19 kB)
remote: Building wheels for collected packages: cloudinary, psycopg2
remote: Building wheel for cloudinary (setup.py): started
remote: Building wheel for cloudinary (setup.py): finished with status 'done'
remote: Created wheel for cloudinary: filename=cloudinary-1.26.0-py3-none-any.whl size=134187 sha256=a8e60aba890ebec526fa450889f89331a3f91deb0951c91ab9e6cbcf4452cf43
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-nqiyqf0q/wheels/58/0d/32/997fc6c26f83c9ae73a1bcd41028973512175982df608523ef
remote: Building wheel for psycopg2 (setup.py): started
remote: Building wheel for psycopg2 (setup.py): finished with status 'done'
remote: Created wheel for psycopg2: filename=psycopg2-2.9.4-cp310-cp310-linux_x86_64.whl size=159965 sha256=8087037db2c9ec2fdbae93eb5afd833509bbcbdbd546e980794242a06e01b87a
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-nqiyqf0q/wheels/10/07/ca/a5e7863aeec605e8a19ea9ccc90bb594784c287cc5534bbecb
remote: Successfully built cloudinary psycopg2
remote: Installing collected packages: whitenoise, urllib3, tzdata, sqlparse, six, psycopg2, gunicorn, certifi, asgiref, Django, cloudinary, dj-database-url, django-heroku
remote: Successfully installed Django-4.1.2 asgiref-3.5.2 certifi-2022.9.24 cloudinary-1.26.0 dj-database-url-1.0.0 django-heroku-0.3.1 gunicorn-20.1.0 psycopg2-2.9.4 six-1.16.0 sqlparse-0.4.3 tzdata-2022.4 urllib3-1.26.12 whitenoise-6.2.0
remote: -----> $ python manage.py collectstatic --noinput
remote: Post-processing 'js/load-image.all.min.js' failed!
remote: Traceback (most recent call last):
remote: File "/tmp/build_f2d02e58/manage.py", line 22, in <module>
remote: main()
remote: File "/tmp/build_f2d02e58/manage.py", line 18, in main
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
remote: self.execute(*args, **cmd_options)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
remote: output = self.handle(*args, **options)
remote: File "/app/.heroku/python/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
remote: collected = self.collect()
remote: File "/app/.heroku/python/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 154, in collect
remote: raise processed
remote: whitenoise.storage.MissingFileError: The file 'js/load-image.all.min.js.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f5b6e77dd50>.
remote: The JS file 'js/load-image.all.min.js' references a file which could not be found:
remote: js/load-image.all.min.js.map
remote: Please check the URL references in this JS file, particularly any
remote: relative paths which might be pointing to the wrong location.
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:
remote: ****** Collectstatic environment variables:
remote:
remote: PYTHONUNBUFFERED=1
remote: PKG_CONFIG_PATH=/app/.heroku/vendor/lib/pkg-config:/app/.heroku/python/lib/pkg-config:
remote: DEBUG_COLLECTSTATIC=1
remote: BPLOG_PREFIX=buildpack.python
remote: PWD=/tmp/build_f2d02e58
remote: HOME=/app
remote: LANG=en_US.UTF-8
remote: SOURCE_VERSION=495ce7e183efedd2df883a898d49dab71e966050
remote: REQUEST_ID=8dbf04e4-d06f-2a07-26fd-fd9f783c0707
remote: ENV_DIR=/tmp/d20221008-55-86y9b6
remote: PYTHONPATH=.
remote: CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:/app/.heroku/python/include:
remote: BIN_DIR=/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin
remote: LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:
remote: SHLVL=1
remote: LD_LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:
remote: PIP_NO_PYTHON_VERSION_WARNING=1
remote: BUILDPACK_LOG_FILE=/dev/null
remote: STACK=heroku-22
remote: BUILD_DIR=/tmp/build_f2d02e58
remote: CACHE_DIR=/tmp/codon/tmp/cache
remote: PATH=/app/.heroku/python/bin:/app/.heroku/vendor/bin::/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/vendor/
remote: EXPORT_PATH=/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin/../export
remote: C_INCLUDE_PATH=/app/.heroku/vendor/include:/app/.heroku/python/include:
remote: DYNO=run.5998
remote: PROFILE_PATH=/tmp/build_f2d02e58/.profile.d/python.sh
remote: OLDPWD=/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136
remote: _=/usr/bin/env
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 495ce7e183efedd2df883a898d49dab71e966050
remote: !
remote: ! We have detected that you have triggered a build from source code with version 495ce7e183efedd2df883a898d49dab71e966050
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to immense-brushlands-83439.
remote:
To https://git.heroku.com/immense-brushlands-83439.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/immense-brushlands-83439.git'
I am trying to deploy a django app I created to heroku. When i do git push heroku master an error shows remote: cp: cannot create regular file '/app/tmp/cache/.heroku/requirements.txt': No such file or directory.
here is the full log:
Enumerating objects: 35, done.
Counting objects: 100% (35/35), done.
Delta compression using up to 2 threads
Compressing objects: 100% (32/32), done.
Writing objects: 100% (35/35), 12.68 KiB | 405.00 KiB/s, done.
Total 35 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: cp: cannot create regular file '/app/tmp/cache/.heroku/requirements.txt': No such file or directory
remote: -----> Installing python-3.6.10
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: Sqlite3 successfully installed.
remote: -----> Installing requirements with pip
remote: Collecting asgiref==3.2.7
remote: Downloading asgiref-3.2.7-py2.py3-none-any.whl (19 kB)
remote: Collecting astroid==2.3.3
remote: Downloading astroid-2.3.3-py3-none-any.whl (205 kB)
remote: Collecting colorama==0.4.3
remote: Downloading colorama-0.4.3-py2.py3-none-any.whl (15 kB)
remote: Collecting dj-database-url==0.5.0
remote: Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
remote: Collecting Django==3.0.5
remote: Downloading Django-3.0.5-py3-none-any.whl (7.5 MB)
remote: Collecting django-heroku==0.3.1
remote: Downloading django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
remote: Collecting gunicorn==20.0.4
remote: Downloading gunicorn-20.0.4-py2.py3-none-any.whl (77 kB)
remote: Collecting isort==4.3.21
remote: Downloading isort-4.3.21-py2.py3-none-any.whl (42 kB)
remote: Collecting lazy-object-proxy==1.4.3
remote: Downloading lazy_object_proxy-1.4.3-cp36-cp36m-manylinux1_x86_64.whl (55 kB)
remote: Collecting mccabe==0.6.1
remote: Downloading mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
remote: Collecting psycopg2==2.8.5
remote: Downloading psycopg2-2.8.5.tar.gz (380 kB)
remote: Collecting pylint==2.4.4
remote: Downloading pylint-2.4.4-py3-none-any.whl (302 kB)
remote: Collecting pytz==2019.3
remote: Downloading pytz-2019.3-py2.py3-none-any.whl (509 kB)
remote: Collecting six==1.14.0
remote: Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
remote: Collecting sqlparse==0.3.1
remote: Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
remote: Collecting typed-ast==1.4.1
remote: Downloading typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl (737 kB)
remote: Collecting whitenoise==5.0.1
remote: Downloading whitenoise-5.0.1-py2.py3-none-any.whl (20 kB)
remote: Collecting wrapt==1.11.2
remote: Downloading wrapt-1.11.2.tar.gz (27 kB)
remote: Building wheels for collected packages: psycopg2, wrapt
remote: Building wheel for psycopg2 (setup.py): started
remote: Building wheel for psycopg2 (setup.py): finished with status 'done'
remote: Created wheel for psycopg2: filename=psycopg2-2.8.5-cp36-cp36m-linux_x86_64.whl size=447249 sha256=8c3101c70eafd1ccd9ef08021cf553d3c10d55ac62b1c191b19735ab3c026e5a
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-025326ex/wheels/52/9a/ab/22a0d1dc560ad5c0d09cc1c968015f89726e7e01c190dee110
remote: Building wheel for wrapt (setup.py): started
remote: Building wheel for wrapt (setup.py): finished with status 'done'
remote: Created wheel for wrapt: filename=wrapt-1.11.2-cp36-cp36m-linux_x86_64.whl size=69767 sha256=974a65540f5d88c324d2c7cd1c4379cbaa7e2c1a03e599864be4c2ffbe4e17af
remote: Stored in directory: /tmp/pip-ephem-wheel-cache-025326ex/wheels/0d/85/48/15d7bfab92a2d0e87372224c1f628fc57db7447a663a58e86c
remote: Successfully built psycopg2 wrapt
remote: Installing collected packages: asgiref, lazy-object-proxy, typed-ast, six, wrapt, astroid, colorama, dj-database-url, sqlparse, pytz, Django, psycopg2, whitenoise, django-heroku, gunicorn, isort, mccabe, pylint
remote: Successfully installed Django-3.0.5 asgiref-3.2.7 astroid-2.3.3 colorama-0.4.3 dj-database-url-0.5.0 django-heroku-0.3.1 gunicorn-20.0.4 isort-4.3.21 lazy-object-proxy-1.4.3 mccabe-0.6.1 psycopg2-2.8.5 pylint-2.4.4 pytz-2019.3 six-1.14.0 sqlparse-0.3.1 typed-ast-1.4.1 whitenoise-5.0.1 wrapt-1.11.2
remote: -----> $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 21, in <module>
remote: main()
remote: File "manage.py", line 17, in main
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 328, in run_from_argv
remote: self.execute(*args, **cmd_options)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/base.py", line 369, in execute
remote: output = self.handle(*args, **options)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle
remote: collected = self.collect()
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 104, in collect
remote: for path, storage in finder.list(self.ignore_patterns):
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/finders.py", line 130, in list
remote: for path in utils.get_files(storage, ignore_patterns):
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/staticfiles/utils.py", line 23, in get_files
remote: directories, files = storage.listdir(location)
remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/files/storage.py", line 316, in listdir
remote: for entry in os.scandir(path):
remote: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/build_8b272f59d204dc1b5699579647b39ae3/static_in_env'
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 pure-plains-36964.
remote:
To https://git.heroku.com/pure-plains-36964.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pure-plains-36964.git'
I do have requirements.txt in my root directory with everything included. Please help
There is indeed a requirements.txt error but that does not stop the build.
The error is something with your django collectstatic. Might be because you have an empty folder in called static_in_env. You may follow the recommendation in the stack trace, i.e. run:
$ heroku config:set DISABLE_COLLECTSTATIC=1
But if you need the collectstatic to run then revert that flag:
$ heroku config:set DISABLE_COLLECTSTATIC=0
and then debug why it is empty. It is hard to tell without more context.
As for the requirements.txt, make sure you only have one requirements.txt. If you have more than one, make sure they all have some text in them. Hope this helps.
I have been trying to deploy a Django web app to Heroku and I have dlib as a dependency. I have tried adding the build pack for which installs dlib and opencv. This is the buildpack that I have tried. But this does not work as this has become stale. I don't know if there is any other way to install dlib on Heroku?
Here is the requirements.txt file for my app:
dj-database-url==0.3.0
dj-static==0.0.6
gunicorn==19.7.1
Unipath==1.0
python-decouple==3
click==6.7
numpy==1.15.4
Pillow==5.2.0
face-recognition-models==0.3.0
cmake
Werkzeug==0.14.1
face-recognition==1.2.3
boost==0.1
boost-py
dlib==19.4.0
psycopg2==2.7.5
whitenoise==3.2
jsonschema==2.6.0
and this is the error that I get when I push to heroku master:
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 704 bytes | 0 bytes/s, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote: Collecting Django==2.1.1 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 1))
remote: Downloading https://files.pythonhosted.org/packages/ca/7e/fc068d164b32552ae3a8f8d5d0280c083f2e8d553e71ecacc21927564561/Django-2.1.1-py3-none-any.whl (7.3MB)
remote: Collecting dj-database-url==0.3.0 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 2))
remote: Downloading https://files.pythonhosted.org/packages/ef/b6/9283fcf61ced22bf90e7b4a84ba5b53d126b2c9b0dc9b667347698097026/dj_database_url-0.3.0-py2.py3-none-any.whl
remote: Collecting dj-static==0.0.6 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 3))
remote: Downloading https://files.pythonhosted.org/packages/2b/8f/77a4b8ec50c821193bf9682c7896f12fd0418eb3711a7d66796ede59c23b/dj-static-0.0.6.tar.gz
remote: Collecting gunicorn==19.7.1 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 4))
remote: Downloading https://files.pythonhosted.org/packages/64/32/becbd4089a4c06f0f9f538a76e9fe0b19a08f010bcb47dcdbfbc640cdf7d/gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
remote: Collecting Unipath==1.0 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 5))
remote: Downloading https://files.pythonhosted.org/packages/5e/8e/7efe289440c9d3b3f2784516fef1362428d1c00d35ca31c39d7bee1412e8/Unipath-1.0.tar.gz
remote: Collecting python-decouple==3 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 6))
remote: Downloading https://files.pythonhosted.org/packages/5f/fc/9f3ec3f7844f9045406562512dbb599e9576e0c2ce3192a5e4d459f66e99/python-decouple-3.0.tar.gz
remote: Collecting click==6.7 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 7))
remote: Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
remote: Collecting numpy==1.15.4 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 8))
remote: Downloading https://files.pythonhosted.org/packages/ff/7f/9d804d2348471c67a7d8b5f84f9bc59fd1cefa148986f2b74552f8573555/numpy-1.15.4-cp36-cp36m-manylinux1_x86_64.whl (13.9MB)
remote: Collecting Pillow==5.2.0 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 9))
remote: Downloading https://files.pythonhosted.org/packages/d1/24/f53ff6b61b3d728b90934bddb4f03f8ab584a7f49299bf3bde56e2952612/Pillow-5.2.0-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
remote: Collecting face-recognition-models==0.3.0 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 10))
remote: Downloading https://files.pythonhosted.org/packages/cf/3b/4fd8c534f6c0d1b80ce0973d01331525538045084c73c153ee6df20224cf/face_recognition_models-0.3.0.tar.gz (100.1MB)
remote: Collecting cmake (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 11))
remote: Downloading https://files.pythonhosted.org/packages/45/c4/e69313ade2a3e992e7178744b0e56bdd8f23e79e15066a68cf490504beed/cmake-3.13.3-cp36-cp36m-manylinux1_x86_64.whl (15.9MB)
remote: Collecting Werkzeug==0.14.1 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 12))
remote: Downloading https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
remote: Collecting face-recognition==1.2.3 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 13))
remote: Downloading https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
remote: Collecting boost==0.1 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 14))
remote: Downloading https://files.pythonhosted.org/packages/cd/e9/fd77f318eba4976c9ed9df341c13daebe69cace8723dbd0f3d39a0dddb08/boost-0.1.tar.gz
remote: Collecting boost-py (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 15))
remote: Downloading https://files.pythonhosted.org/packages/f7/be/28a09dacd0770d281bd3798f148dc431503b726b7219cec1fdb6faca46e6/boost_py-0.0.2-py3-none-any.whl
remote: Collecting dlib==19.4.0 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 16))
remote: Downloading https://files.pythonhosted.org/packages/1d/76/0f91fde37a83a40cf27e6cabd900b975c2667c522a07ae38e31cda2fa486/dlib-19.4.0.tar.gz (4.0MB)
remote: Collecting psycopg2==2.7.5 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 17))
remote: Downloading https://files.pythonhosted.org/packages/5e/d0/9e2b3ed43001ebed45caf56d5bb9d44ed3ebd68e12b87845bfa7bcd46250/psycopg2-2.7.5-cp36-cp36m-manylinux1_x86_64.whl (2.7MB)
remote: Collecting whitenoise==3.2 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 18))
remote: Downloading https://files.pythonhosted.org/packages/ed/7b/2d8276a56b6ebb7c0b8652a31e535df67f0e4152037b33ce036e79146ac3/whitenoise-3.2-py2.py3-none-any.whl
remote: Collecting jsonschema==2.6.0 (from -r /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/requirements.txt (line 19))
remote: Downloading https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
remote: Installing collected packages: Django, dj-database-url, dj-static, gunicorn, Unipath, python-decouple, click, numpy, Pillow, face-recognition-models, cmake, Werkzeug, dlib, face-recognition, boost, boost-py, psycopg2, whitenoise, jsonschema
remote: Running setup.py install for dj-static: started
remote: Running setup.py install for dj-static: finished with status 'done'
remote: Running setup.py install for Unipath: started
remote: Running setup.py install for Unipath: finished with status 'done'
remote: Running setup.py install for python-decouple: started
remote: Running setup.py install for python-decouple: finished with status 'done'
remote: Running setup.py install for face-recognition-models: started
remote: Running setup.py install for face-recognition-models: finished with status 'done'
remote: Running setup.py install for dlib: started
remote: Running setup.py install for dlib: finished with status 'error'
remote: Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-otsn5okf/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-diaey5c7-record/install-record.txt --single-version-externally-managed --compile:
remote: running install
remote: running build
remote: Detected Python architecture: 64bit
remote: Detected platform: linux
remote: Configuring cmake ...
remote: -- The C compiler identification is GNU 7.3.0
remote: -- The CXX compiler identification is GNU 7.3.0
remote: -- Check for working C compiler: /usr/bin/cc
remote: -- Check for working C compiler: /usr/bin/cc -- works
remote: -- Detecting C compiler ABI info
remote: -- Detecting C compiler ABI info - done
remote: -- Detecting C compile features
remote: -- Detecting C compile features - done
remote: -- Check for working CXX compiler: /usr/bin/c++
remote: -- Check for working CXX compiler: /usr/bin/c++ -- works
remote: -- Detecting CXX compiler ABI info
remote: -- Detecting CXX compiler ABI info - done
remote: -- Detecting CXX compile features
remote: -- Detecting CXX compile features - done
remote: CMake Warning at /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.13/Modules/FindBoost.cmake:1775 (message):
remote: No header defined for python-py34; skipping header check
remote: Call Stack (most recent call first):
remote: /tmp/pip-build-otsn5okf/dlib/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
remote: CMakeLists.txt:6 (include)
remote: -- Could NOT find Boost
remote: CMake Warning at /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.13/Modules/FindBoost.cmake:1775 (message):
remote: No header defined for python-py35; skipping header check
remote: Call Stack (most recent call first):
remote: /tmp/pip-build-otsn5okf/dlib/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
remote: CMakeLists.txt:6 (include)
remote: -- Could NOT find Boost
remote: -- Could NOT find Boost
remote: -- Could NOT find Boost
remote: -- Found PythonLibs: /tmp/build_6d2057dd8ed43f6db2772ce68b91cc1d/.heroku/python/lib/libpython3.6m.a (found suitable version "3.6.8", minimum required is "3.4")
remote: -- *****************************************************************************************************
remote: -- To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder
remote: -- and run these commands:
remote: -- ./bootstrap.sh --with-libraries=python
remote: -- ./b2
remote: -- sudo ./b2 install
remote: -- *****************************************************************************************************
remote: CMake Error at /tmp/pip-build-otsn5okf/dlib/dlib/cmake_utils/add_python_module:116 (message):
remote: Boost python library not found.
remote: Call Stack (most recent call first):
remote: CMakeLists.txt:6 (include)
remote: -- Configuring incomplete, errors occurred!
remote: See also "/tmp/pip-build-otsn5okf/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
remote: error: cmake configuration failed!
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-otsn5okf/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-diaey5c7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-otsn5okf/dlib/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to app.
remote:
To https://git.heroku.com/app.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/app.git'
Thanks in advance.
boost==0.1
cmake==0.7.1
boost-py
face_recognition_models
face_recognition
dlib>=19.3.0
numpy
Pillow
scipy>=0.17.0
aniso8601==1.2.0
asn1crypto==0.24.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.7
cryptography==1.9
Flask==0.12.1
Flask-Ask==0.9.7
gunicorn==19.7.1
idna==2.6
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
pycparser==2.18
pyOpenSSL==17.0.0
python-dateutil==2.7.2
PyYAML==3.12
requests==2.18.4
six==1.11.0
Unidecode==1.0.22
urllib3==1.22
Werkzeug==0.14.1
You need cmake to install dlib. To install cmake in heroku you need to buildpack cmake and set that build in order to install dlib.
You can use this buildpack for cmake heroku-buildpack-cmake
Do this in your CLI
Login to heroku
copy paste heroku create --buildpack https://github.com/VovchikMonkey/heroku-buildpack-cmake.git
And finally set the buildpack heroku buildpacks:set
https://github.com/Starkast/heroku-buildpack-cmake
And then deploy
$ git add .
$ git commit -am "make it better"
$ git push heroku master
You need set buildpack as heroku buildpacks:set https://github.com/heroku/heroku-buildpack-python.git
I am trying to push on my Heroku app and getting error while installing PIL on server, I have tried by tweaking my requirements.txt as given below
Django==1.4.5
Fabric==1.4.3
--allow-all-external
--allow-unverified PIL
PIL==1.1.7
#Pillow==2.3.0
Also tried by adding parameters at start of requirements.txt as given below:
--allow-all-external
--allow-unverified PIL
Django==1.4.5
Fabric==1.4.3
PIL==1.1.7
#Pillow==2.3.0
this is failing with error:
remote: InsecurePlatformWarning
remote: Downloading Django-1.4.5.tar.gz (7.7MB)
remote: Collecting Fabric==1.4.3 (from -r requirements.txt (line 2))
remote: Downloading Fabric-1.4.3.tar.gz (221kB)
remote: Collecting PIL==1.1.7 (from -r requirements.txt (line 5))
remote: Could not find a version that satisfies the requirement PIL==1.1.7 (
om -r requirements.txt (line 5)) (from versions: )
remote: No matching distribution found for PIL==1.1.7 (from -r requirements.tx
(line 5))
remote:
remote:
remote: ! Push rejected, failed to compile Python app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to my-test-app.
remote:
Use Pillow instead of PIL. PIL is not maintained and has not had a new release since 2009. Pillow is a maintained fork.
I'm having issues with deploying my website with pymssql onto heroku. I'm using the following build pack and still am having errors:
heroku config:add BUILDPACK_URL=https://github.com/amanjain/heroku-buildpack-python-freetds-pymssql.git
This is the error that I keep getting:
remote: warning: no files found matching 'pymssql_version.py'
remote: warning: no files found matching 'win32/freetds.zip'
remote: warning: no previously-included files matching '*' found under directory 'docs/_build'
remote: Successfully installed pymssql
remote: Cleaning up...
remote: -----> Installing dependencies with pip
remote: Downloading/unpacking bottle==0.12.9 (from -r requirements.txt (line 1))
remote: Running setup.py (path:/tmp/pip_build_u13919/bottle/setup.py) egg_info for package bottle
remote:
remote: Downloading/unpacking DateTime==4.0.1 (from -r requirements.txt (line 2))
remote: Running setup.py (path:/tmp/pip_build_u13919/DateTime/setup.py) egg_info for package DateTime
remote:
remote: Downloading/unpacking functools32==3.2.3.post2 (from -r requirements.txt (line 3))
remote: Could not find a version that satisfies the requirement functools32==3.2.3.post2 (from -r requirements.txt (line 3)) (from versions: 3.2.3-1, 3.2.3-1, 3.2.3-2, 3.2.3-2)
remote: Cleaning up...
remote: No distributions matching the version for functools32==3.2.3.post2 (from -r requirements.txt (line 3))
remote: Storing debug log for failure in /app/.pip/pip.log
remote:
remote: ! Push rejected, failed to compile Python + FreeTDS + pymssql app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to shelf2xerotest1.
remote:
To https://git.heroku.com/shelf2xerotest1.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/shelf2xerotest1.git'
Has anyone else run into this issue?
It looks like that buildpack is built for Linux systems, and it appears you're trying to install it on Windows.
In the trace log, it appears to be looking for a FreeTDS build in a win32 directory:
warning: no files found matching 'win32/freetds.zip'
It also appears to be install Python 2.7. If you're just getting started, I'd strongly recommend using Python 3. Good luck.