Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for installing dependancies - error installing pcapy #19

Open
italovalcy opened this issue Jun 14, 2021 · 0 comments

Comments

@italovalcy
Copy link
Member

Hi,

If we try to install the requirements for ofp_sniffer using pip on a fresh Debian/Ubuntu installation, we get the following error:

# pip install -r docs/requirements.txt
...
Failed to build pcapy
Installing collected packages: PyYAML, python-dateutil, msgpack, termcolor, pyaml, pcapy, netaddr, influxdb, hexdump
    Running setup.py install for pcapy ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-12bp3vbv/pcapy_4d7b3afc73b248658b43d9a05a1d04b6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-12bp3vbv/pcapy_4d7b3afc73b248658b43d9a05a1d04b6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jif4eurr/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/pcapy
         cwd: /tmp/pip-install-12bp3vbv/pcapy_4d7b3afc73b248658b43d9a05a1d04b6/
    Complete output (9 lines):
    running install
    running build
    running build_ext
    building 'pcapy' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    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 -I/usr/include/python3.7m -c pcapdumper.cc -o build/temp.linux-x86_64-3.7/pcapdumper.o
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    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 io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-12bp3vbv/pcapy_4d7b3afc73b248658b43d9a05a1d04b6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-12bp3vbv/pcapy_4d7b3afc73b248658b43d9a05a1d04b6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jif4eurr/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/pcapy Check the logs for full command output.

After fixing the gcc issue, new issues are raised:

  • pcapdumper.cc:10:10: fatal error: Python.h: No such file or directory
  • pcapdumper.cc:11:10: fatal error: pcap.h: No such file or directory

Steps to reproduce:

  1. Using a fresh Debian/Ubuntu install (e.g., docker image debian:buster)
  2. Follow the instructions to install ofp_sniffer in the README.md file

Thus, it would be interesting to update the Installation process documentation (README.md lines 40-47) to also include this low level dependency:

apt-get install build-essential python3-dev libpcap-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant