0
Collecting django-heroku
  Using cached django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB)
Requirement already satisfied: django in /home/aksh/dadu/lib/python3.8/site-packages (from django-heroku) (3.1.1)
Requirement already satisfied: whitenoise in /home/aksh/dadu/lib/python3.8/site-packages (from django-heroku) (5.2.0)
Requirement already satisfied: dj-database-url>=0.5.0 in /home/aksh/dadu/lib/python3.8/site-packages (from django-heroku) (0.5.0)
Collecting psycopg2
  Using cached psycopg2-2.8.6.tar.gz (383 kB)
Requirement already satisfied: asgiref~=3.2.10 in /home/aksh/dadu/lib/python3.8/site-packages (from django->django-heroku) (3.2.10)
Requirement already satisfied: sqlparse>=0.2.2 in /home/aksh/dadu/lib/python3.8/site-packages (from django->django-heroku) (0.3.1)
Requirement already satisfied: pytz in /home/aksh/dadu/lib/python3.8/site-packages (from django->django-heroku) (2020.1)
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/aksh/dadu/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a2qiah3p/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a2qiah3p/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-xvu3w4ef
       cwd: /tmp/pip-install-a2qiah3p/psycopg2/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
  
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2, django-heroku
    Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/aksh/dadu/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a2qiah3p/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a2qiah3p/psycopg2/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-record-7sdx4nwd/install-record.txt --single-version-externally-managed --compile --install-headers /home/aksh/dadu/include/site/python3.8/psycopg2
         cwd: /tmp/pip-install-a2qiah3p/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/psycopg
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120003 -DHAVE_LO64=1 -I/home/aksh/dadu/include -I/usr/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/12/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement                                                                                                                        
    In file included from psycopg/psycopgmodule.c:28:                                                                                                                                                                                      
    ./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory                                                                                                                                                          
       36 | #include <libpq-fe.h>                                                                                                                                                                                                          
          |          ^~~~~~~~~~~~                                                                                                                                                                                                          
    compilation terminated. 
                                                                                                                                                                                                                                                                                                                                                                                                                                                      

It appears you are missing some prerequisite to build the package from source.

You may install a binary package by installing 'psycopg2-binary' from PyPI.                                                                                                                                                            
If you want to install psycopg2 from source, please install the packages                                                                                                                                                               
required for the build and try again.                                                                                                                                                                                                  
                                                                                                                                                                                                                                       
For further information please check the 'doc/src/install.rst' file (also at                                                                                                                                                           
<https://www.psycopg.org/docs/install.html>).                                                                                                                                                                                          
                                                                                                                                                                                                                                       
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1                                                                                                                                                                        
----------------------------------------                                                                                                                                                                                               

ERROR: Command errored out with exit status 1: /home/aksh/dadu/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a2qiah3p/psycopg2/setup.py'"'"'; file='"'"'/tmp/pip-install-a2qiah3p/psycopg2/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-record-7sdx4nwd/install-record.txt --single-version-externally-managed --compile --install-headers /home/aksh/dadu/include/site/python3.8/psycopg2 Check the logs for full command output.

when iam running command it gives this error. it also give this error with many other python packages .

is there any other way to download django-heroku.

phd
  • 82,685
  • 13
  • 120
  • 165
  • The error is for `psycopg2`, not `django-heroku`. Try changing `psycopg2` to `psycopg2-binary` in your requirements, as the message suggests. – Alasdair Sep 10 '20 at 11:41
  • The last [`django-heroku`](https://pypi.org/project/django-heroku/) release was in 2018. You shouldn't need to install it to run a Django application on Heroku. I wouldn't try to install it unless you are absolutely sure you need to - I don't think it's going to fix the problem you described [here](https://stackoverflow.com/questions/63825725/heroku-run-python-manage-py-migrate-do-not-create-table-on-heroku-server). – Alasdair Sep 10 '20 at 11:45

1 Answers1

0

To install Django on Heroku go to the command line and instead of:

django-heroku

Use:

pip install django-on-heroku

Source

RiveN
  • 2,595
  • 11
  • 13
  • 26