Postgre sql problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Postgre sql problem

Elmaco7
Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/31838b61-ee71-4517-a1cb-a3565aaaea16%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Postgre sql problem

Thomas Lockhart
You need the python-devel package installed for the version of python you are running.

- Tom

On Sep 6, 2019, at 12:49 PM, Elmaco7 <[hidden email]> wrote:

Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/31838b61-ee71-4517-a1cb-a3565aaaea16%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/436E96A4-B4C2-47E0-B167-2F6A1EE83EAE%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Postgre sql problem

N'BE SORO
Hello. 
Install psycopg2 binary version

Le ven. 6 sept. 2019 à 22:06, Thomas Lockhart <[hidden email]> a écrit :
You need the python-devel package installed for the version of python you are running.

- Tom

On Sep 6, 2019, at 12:49 PM, Elmaco7 <[hidden email]> wrote:

Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/31838b61-ee71-4517-a1cb-a3565aaaea16%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/436E96A4-B4C2-47E0-B167-2F6A1EE83EAE%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOtSHp-GTJEr6GtcjX3cpefLxyiMNij7LW3NHXrHL31t4yn-sg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Postgre sql problem

Team Infinity
In reply to this post by Elmaco7
You must have postresql installed so as to install psycopg2 :)

On Saturday, September 7, 2019 at 1:34:31 AM UTC+5:45, Elmaco7 wrote:
Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached <a href="https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ffiles.pythonhosted.org%2Fpackages%2F5c%2F1c%2F6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165%2Fpsycopg2-2.8.3.tar.gz\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFY9PdoX2CCBKA8LknTluMVsGMvrw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ffiles.pythonhosted.org%2Fpackages%2F5c%2F1c%2F6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165%2Fpsycopg2-2.8.3.tar.gz\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFY9PdoX2CCBKA8LknTluMVsGMvrw&#39;;return true;">https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <<a href="http://initd.org/psycopg/docs/install.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Finitd.org%2Fpsycopg%2Fdocs%2Finstall.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuij2IYnKP6rknl71_siaBPWXkEQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Finitd.org%2Fpsycopg%2Fdocs%2Finstall.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuij2IYnKP6rknl71_siaBPWXkEQ&#39;;return true;">http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <<a href="http://initd.org/psycopg/docs/install.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Finitd.org%2Fpsycopg%2Fdocs%2Finstall.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuij2IYnKP6rknl71_siaBPWXkEQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Finitd.org%2Fpsycopg%2Fdocs%2Finstall.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHuij2IYnKP6rknl71_siaBPWXkEQ&#39;;return true;">http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cba54744-360f-4d79-bbc5-c9b320f9acb3%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Postgre sql problem

Aniket Jain
In reply to this post by Elmaco7
Hello , 
Please pip install psycopg2

On Sat, 7 Sep, 2019, 1:19 AM Elmaco7, <[hidden email]> wrote:
Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/31838b61-ee71-4517-a1cb-a3565aaaea16%40googlegroups.com.

On Sat, 7 Sep, 2019, 1:19 AM Elmaco7, <[hidden email]> wrote:
Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/31838b61-ee71-4517-a1cb-a3565aaaea16%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADV%2BovJ3wL%3DF9P0HdjtJQ2aRaNXXJTj%2BBmee1hU-LX4%2B7KP7ow%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Postgre sql problem

acema alex
In reply to this post by Team Infinity
Try to follow these steps;
- Install PostgreSQL,
-install psycopg2 binary version ,
-create the database in the PostgreSQL,
- then go to your settings.py of your project and do these on the database setting
DATABASES = {
        'defaults': {
                   'ENGINE': 'Django.db.backends.postgresql_psycopg2',
                    'NAME': ('DB_NAME'),
                    'USER': ('DB_USER'),
                   'PASSWORD': ('DB_PASS'),
                   'HOST' : 'localhost',
                   'PORT': '5432',
}
}
Wish you the best in Codding.



On Tue, Sep 10, 2019 at 5:34 PM Team Infinity <[hidden email]> wrote:
You must have postresql installed so as to install psycopg2 :)

On Saturday, September 7, 2019 at 1:34:31 AM UTC+5:45, Elmaco7 wrote:
Hello, I'm trying to use Postresql with my django project, but when i try to install psycopg2(with this command 'pip3 install psycopg2')  this problem appears:

Collecting psycopg2
  Using cached https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-mkc6kj2i --python-tag cp36
       cwd: /tmp/pip-install-t391_oat/psycopg2/
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psycopg2
  copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
  copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
  running build_ext
  building 'psycopg2._psycopg' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psycopg
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
  In file included from psycopg/psycopgmodule.c:27:0:
  ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
   #include <Python.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
  <http://initd.org/psycopg/docs/install.html>).
 
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psycopg2
  Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
         cwd: /tmp/pip-install-t391_oat/psycopg2/
    Complete output (40 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psycopg2
    copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
    copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
    running build_ext
    building 'psycopg2._psycopg' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psycopg
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m -I/home/user/myproject/myprojectenv/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
    In file included from psycopg/psycopgmodule.c:27:0:
    ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or directory
     #include <Python.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
    <http://initd.org/psycopg/docs/install.html>).
   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t391_oat/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-bl1kkv0m/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2 Check the logs for full command output.

Can someone help me?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cba54744-360f-4d79-bbc5-c9b320f9acb3%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMDcbq80K4cTZXV%2B%2Bhsr%3DYQF-3GKUU_M0i_y-O69_D0wqvSaDQ%40mail.gmail.com.