title: python - can't install psycopg2 on centos 7
body: <p>I'm trying to config Django on centos 7
  According to this article <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-centos-7" rel="noreferrer">Here</a></p>
  
  <p>I installed </p>
  
  <pre><code>sudo yum install python-pip python-devel postgresql-server postgresql-devel postgresql-contrib gcc nginx 
  </code></pre>
  
  <p>After setup  PostgreSQL for Django like creating a database, ...
  I try installing psycopg2 on virtualenv</p>
  
  <pre><code>pip install django gunicorn psycopg2
  </code></pre>
  
  <p>but I got this error,
  Anyone can help me?</p>
  
  <pre><code>Collecting psycopg2
    Using cached psycopg2-2.6.2.tar.gz
  Installing collected packages: psycopg2
    Running setup.py install for psycopg2 ... error
      Complete output from command /usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-n0buiow5/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-jk1w8dv1-record/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.4
      creating build/lib.linux-x86_64-3.4/psycopg2
      copying lib/tz.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/pool.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/extras.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/extensions.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/_range.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/__init__.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/psycopg1.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/_json.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      copying lib/errorcodes.py -&gt; build/lib.linux-x86_64-3.4/psycopg2
      creating build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_errcodes.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/dbapi20.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_bug_gc.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_async.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/testconfig.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_quote.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_extras_dictcursor.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_types_basic.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_transaction.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_cancel.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_dates.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_lobject.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/dbapi20_tpc.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_copy.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_types_extras.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_psycopg2_dbapi20.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_module.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/__init__.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_green.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/testutils.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_with.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_cursor.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_connection.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_notify.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      copying tests/test_bugX000.py -&gt; build/lib.linux-x86_64-3.4/psycopg2/tests
      Skipping optional fixer: buffer
      Skipping optional fixer: idioms
      Skipping optional fixer: set_literal
      Skipping optional fixer: ws_comma
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-3.4
      creating build/temp.linux-x86_64-3.4/psycopg
      gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.2 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090212 -I/usr/include/python3.4m -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement
      In file included from psycopg/psycopgmodule.c:27:0:
      ./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory
       #include &lt;Python.h&gt;
                          ^
      compilation terminated.
      error: command 'gcc' failed with exit status 1
  
      ----------------------------------------
  Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-n0buiow5/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-jk1w8dv1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-n0buiow5/psycopg2/
  </code></pre>