2017-07-01 3 views
0

Ich versuche installieren Heroku zu bekommen psycopg2 von requirements.txt zu installieren, die enthält:Heroku nicht psycopg2

falcon 
gunicorn>=19.6.0 
gevent>=0.13 
ujson 
SQLAlchemy 
alembic 
psycopg2 

Diese im folgenden Buildprotokoll ergibt:

-----> Python app detected 
-----> Installing requirements with pip 
     Collecting psycopg2 (from -r /tmp/build_e719ee5ccc3230ba0e40249f52a032c8/j4k0bk-MealoApi-15a38366ac18133eb1495aa651a7cad5497101c3/requirements.txt (line 7)) 
     Downloading psycopg2-2.7.1.tar.gz (421kB) 
     Installing collected packages: psycopg2 
     Running setup.py install for psycopg2: started 
      Running setup.py install for psycopg2: finished with status 'error' 
      Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-EVUXmv/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-iefE_6-record/install-record.txt --single-version-externally-managed --compile: 
      running install 
      running build 
      running build_py 
      creating build 
      creating build/lib.linux-x86_64-2.7 
      creating build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/tz.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/psycopg1.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/__init__.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/extensions.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/_json.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/_range.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/extras.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/errorcodes.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/pool.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/sql.py -> build/lib.linux-x86_64-2.7/psycopg2 
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-2.7/psycopg2 
      creating build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/testconfig.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_connection.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_types_extras.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/testutils.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_bugX000.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/__init__.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_with.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/dbapi20.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_transaction.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_types_basic.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_module.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_async.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_copy.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_dates.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_green.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_notify.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_async_keyword.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_lobject.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_bug_gc.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_quote.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_ipaddress.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_cancel.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_cursor.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_replication.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_errcodes.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      copying tests/test_sql.py -> build/lib.linux-x86_64-2.7/psycopg2/tests 
      running build_ext 
      building 'psycopg2._psycopg' extension 
      creating build/temp.linux-x86_64-2.7 
      creating build/temp.linux-x86_64-2.7/psycopg 
      cc -O2 -fPIC -Wimplicit -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=90602 -DHAVE_LO64=1 -I/app/.heroku/python/include -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.6/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement 
      In file included from psycopg/psycopgmodule.c:41:0: 
      ./psycopg/error.h:32:5: error: unknown type name ‘PyBaseExceptionObject’ 
       PyBaseExceptionObject exc; 
       ^
      error: command 'cc' failed with exit status 1 

      ---------------------------------------- 
     Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-EVUXmv/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-iefE_6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-EVUXmv/psycopg2/ 
!  Push rejected, failed to compile Python app. 
!  Push failed 

Dies scheint darauf hinzu befolgen Sie den Herokus-Leitfaden zur Verbindung mit PostgreSQL über Python (https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-python), ich kann jedoch keine Lösung für dieses Problem finden.

+0

Warum verwenden Sie zwei Datenbanken SQLAlchemy und postgreSQL. Probieren Sie es mit nur einem in requirements.txt aus. –

+0

@RajanChahan SQLAlchemy ist ein ORM und verwendet psycopg2, um eine Verbindung mit dem spezifischen Datenbankserver herzustellen (in diesem Fall pgsql). –

Antwort

1

Also das Problem war, weil ich die pypy-5.3.1 Laufzeit verwendet habe. Ich änderte dies zu Python-2.7.13 und es funktioniert.

Verwandte Themen