title: Python3 properly install PyCurl
body: <p>I'm trying to install <code>pycurl</code> on my <code>ubuntu 16.04 LTS</code>, the module looks installed but it gives me &quot;No module named pycurl&quot; when I try to import it from python.
  my python3 version is <code>3.7.8</code></p>
  <p><code>pip3 freeze |grep pycurl</code> tells me that version 7.43 is installed<code>pycurl==7.43.0</code></p>
  <p>I already run successfully :</p>
  <pre><code>apt-get update
  apt-get install python3-pycurl
  </code></pre>
  <p><code>python3 -m pip install pycurl</code> gives me :</p>
  <pre><code>Defaulting to user installation because normal site-packages is not writeable
  Requirement already satisfied: pycurl in /usr/lib/python3/dist-packages (7.43.0)
  </code></pre>
  <p>and <code>python3 -m easy_install pycurl</code> returns :</p>
  <pre><code>WARNING: The easy_install command is deprecated and will be removed in a future version.
  Searching for pycurl
  Best match: pycurl 7.43.0
  Adding pycurl 7.43.0 to easy-install.pth file
  
  Using /usr/lib/python3/dist-packages
  Processing dependencies for pycurl
  Finished processing dependencies for pycurl
  </code></pre>
  <p>after all of these I get this when I try to import the module :</p>
  <pre><code>&gt;&gt;&gt; import pycurl
  Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  ModuleNotFoundError: No module named 'pycurl'
  </code></pre>
  <p>Any idea ?</p>
  <p>#update</p>
  <p>when I try <code>pip3 -v install pycurl --upgrade</code> I get this error</p>
  <pre><code>File &quot;/home/user/.local/lib/python3.7/site- 
  packages/pip/_internal/utils/subprocess.py&quot;, line 242, in 
  call_subprocess
  raise InstallationError(exc_msg)
  pip._internal.exceptions.InstallationError: Command errored out with 
  exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, 
  tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip-install- 
  jrmswlpf/pycurl/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip-install- 
  jrmswlpf/pycurl/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open) 
  (__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', 
  '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' 
  install --record /tmp/pip-record-0mjigz74/install-record.txt --single- 
  version-externally-managed --user --prefix= --compile --install- 
  headers 
  /home/user/.local/include/python3.7m/pycurl Check the logs for full 
  command output.
  Removed build tracker: '/tmp/pip-req-tracker-w67dg62p'
  </code></pre>
  <p>#update 2 :
  I run those commands : <code>sudo apt-get purge python3-pycurl</code> then <code>pip3 freeze|grep pycurl</code> returns nothing =&gt; pycurl is uninstalled</p>
  <p>then, I run  <code>pip3 install pycurl</code></p>
  <pre><code>pip3 install pycurl
  Defaulting to user installation because normal site-packages is not 
  writeable
  Collecting pycurl
  Using cached pycurl-7.43.0.5.tar.gz (216 kB)
  Building wheels for collected packages: pycurl
  Building wheel for pycurl (setup.py) ... error
  ERROR: Command errored out with exit status 1:
  command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; 
  sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-umytzbub/pycurl/setup.py'&quot;'&quot;'; 
  __file__='&quot;'&quot;'/tmp/pip-install- 
  umytzbub/pycurl/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, '&quot;'&quot;'exec'&quot;'&quot;'))' bdist_wheel -d /tmp/pip-wheel-31uhzig0
     cwd: /tmp/pip-install-umytzbub/pycurl/
  Complete output (18 lines):
  Using curl-config (libcurl 7.47.0)
  Using SSL library: GnuTLS
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/curl
  copying python/curl/__init__.py -&gt; build/lib.linux-x86_64-3.7/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  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 -fstack-protector-strong -Wformat - 
  Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC - 
  DPYCURL_VERSION=&quot;7.43.0.5&quot; -DHAVE_CURL_SSL=1 -DHAVE_CURL_GNUTLS=1 - 
  DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o 
  build/temp.linux-x86_64-3.7/src/docstrings.o
  In file included from src/docstrings.c:4:0:
  src/pycurl.h:5:20: fatal error: Python.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pycurl
  Running setup.py clean for pycurl
  Failed to build pycurl
  DEPRECATION: Could not build wheels for pycurl which do not use PEP 
  517. pip will fall back to legacy 'setup.py install' for these. pip 
  21.0 will remove support for this functionality. A possible 
  replacement is to fix the wheel build issue reported above. You can 
  find discussion regarding this at 
  https://github.com/pypa/pip/issues/8368.
  Installing collected packages: pycurl
  Running setup.py install for pycurl ... error
  ERROR: Command errored out with exit status 1:
  command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; 
  sys.argv[0] = '&quot;'&quot;'/tmp/pip-install-umytzbub/pycurl/setup.py'&quot;'&quot;'; 
  __file__='&quot;'&quot;'/tmp/pip-install- 
  umytzbub/pycurl/setup.py'&quot;'&quot;';f=getattr(tokenize, '&quot;'&quot;'open'&quot;'&quot;', 
  open)(__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', 
  '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, 
  '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /tmp/pip-record-62fg7a92/install- 
  record.txt --single-version-externally-managed --user --prefix= -- 
  compile --install-headers 
  /home/user/.local/include/python3.7m/pycurl
       cwd: /tmp/pip-install-umytzbub/pycurl/
  Complete output (18 lines):
  Using curl-config (libcurl 7.47.0)
  Using SSL library: GnuTLS
  running install
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/curl
  copying python/curl/__init__.py -&gt; build/lib.linux-x86_64-3.7/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  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 -fstack-protector-strong -Wformat - 
  Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC - 
  DPYCURL_VERSION=&quot;7.43.0.5&quot; -DHAVE_CURL_SSL=1 -DHAVE_CURL_GNUTLS=1 - 
  DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o 
  build/temp.linux-x86_64-3.7/src/docstrings.o
  In file included from src/docstrings.c:4:0:
  src/pycurl.h:5:20: fatal error: Python.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/bin/python3 -u - 
  c 'import sys, setuptools, tokenize; sys.argv[0] = '&quot;'&quot;'/tmp/pip- 
  install-umytzbub/pycurl/setup.py'&quot;'&quot;'; __file__='&quot;'&quot;'/tmp/pip- 
  install-umytzbub/pycurl/setup.py'&quot;'&quot;';f=getattr(tokenize, 
  '&quot;'&quot;'open'&quot;'&quot;', open) 
  (__file__);code=f.read().replace('&quot;'&quot;'\r\n'&quot;'&quot;', 
  '&quot;'&quot;'\n'&quot;'&quot;');f.close();exec(compile(code, __file__, 
  '&quot;'&quot;'exec'&quot;'&quot;'))' install --record /tmp/pip-record-62fg7a92/install- 
  record.txt --single-version-externally-managed --user --prefix= -- 
  compile --install-headers 
  /home/user/.local/include/python3.7m/pycurl Check the logs for full 
  command output.
  </code></pre>