Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve this "pip install pypcap" error (both in Windows and Ubuntu Linux)

Tags:

python

pip

I get this error:

when I try to install the pypcap library (for Python 2.7.x) on either Windows 7 or Ubuntu 12.04:

The following is the Windows version of the error, but the Linux error is similar, and can post it later:

$ pip install pypcap -U
Collecting pypcap
  Using cached pypcap-1.1.5.tar.gz
    Complete output from command python setup.py egg_info:
    pcap.h not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\
<username>\appdata\local\temp\pip-build-qjf6rt\pypcap\

Thanks for any pointers or advice on this.

like image 884
Vasudev Ram Avatar asked Sep 02 '25 09:09

Vasudev Ram


2 Answers

You need the pcap development library.

On linux, try

sudo apt-get update
sudo apt-get install libpcap0.8-dev

I know nothing of Windows.

Link to relevant question.

like image 170
Louis P. Dartez Avatar answered Sep 04 '25 21:09

Louis P. Dartez


The c library that pypcap depends on is not installed on your machine.

I suggest using Miniconda to manage your entire Python environment. You can install compiled packages for your architecture to your local conda environment, and then your pip command will succeed.

like image 40
thaavik Avatar answered Sep 04 '25 23:09

thaavik