title: Why won't pcapy install the latest version on my Ubuntu 18.04 server?
body: <p>I can see <strong>pcapy</strong> is on <strong>0.11.4</strong> here:</p>
  <p><a href="https://pypi.org/project/pcapy/" rel="nofollow noreferrer">https://pypi.org/project/pcapy/</a></p>
  <p>For me, I can't seem to get a later version:</p>
  <pre><code>pip install pcapy
  
  pcapy (0.10.8)
  </code></pre>
  <p>How do I go about getting the latest? 0.10.8 seems to have a memory leak, and while its not such a biggie on my larger servers, its causing issues on smaller ones as it only has 4gb for the whole server. This is being used as a dependency for Maltrail BTW</p>
  <p><strong>EDIT:</strong> When I try and do an upgrade I get:</p>
  <pre><code>root@ca1:/etc/fail2ban# pip install --upgrade pcapy
  Collecting pcapy
    Using cached https://files.pythonhosted.org/packages/b0/68/b49e008f9e2b5ab727fb4b820c2e7d0914bd8dacb3c2d668a36b6e5d8991/pcapy-0.11.4.tar.gz
  Building wheels for collected packages: pcapy
    Running setup.py bdist_wheel for pcapy ... error
    Complete output from command /usr/bin/python -u -c &quot;import setuptools, tokenize;__file__='/tmp/pip-build-jcvFms/pcapy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))&quot; bdist_wheel -d /tmp/tmptGvI9qpip-wheel- --python-tag cp27:
    running bdist_wheel
    running build
    running build_ext
    building 'pcapy' extension
    creating build
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c pcapdumper.cc -o build/temp.linux-x86_64-2.7/pcapdumper.o
    pcapdumper.cc:11:10: fatal error: pcap.h: No such file or directory
     #include &lt;pcap.h&gt;
              ^~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
    ----------------------------------------
    Failed building wheel for pcapy
    Running setup.py clean for pcapy
  Failed to build pcapy
  Installing collected packages: pcapy
    Found existing installation: pcapy 0.10.8
      Not uninstalling pcapy at /usr/lib/python2.7/dist-packages, outside environment /usr
    Running setup.py install for pcapy ... error
      Complete output from command /usr/bin/python -u -c &quot;import setuptools, tokenize;__file__='/tmp/pip-build-jcvFms/pcapy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))&quot; install --record /tmp/pip-qPqZSL-record/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_ext
      building 'pcapy' extension
      creating build
      creating build/temp.linux-x86_64-2.7
      x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c pcapdumper.cc -o build/temp.linux-x86_64-2.7/pcapdumper.o
      pcapdumper.cc:11:10: fatal error: pcap.h: No such file or directory
       #include &lt;pcap.h&gt;
                ^~~~~~~~
      compilation terminated.
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
      ----------------------------------------
    Can't rollback pcapy, nothing uninstalled.
  Command &quot;/usr/bin/python -u -c &quot;import setuptools, tokenize;__file__='/tmp/pip-build-jcvFms/pcapy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))&quot; install --record /tmp/pip-qPqZSL-record/install-record.txt --single-version-externally-managed --compile&quot; failed with error code 1 in /tmp/pip-build-jcvFms/pcapy/
  </code></pre>