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

ImportError: symbol not found in flat namespace '_ndpi_category_get_name' #180

Open
Guygolpur opened this issue Jun 13, 2023 · 1 comment

Comments

@Guygolpur
Copy link

Guygolpur commented Jun 13, 2023

I am getting this error on MacOS with Python 3.9.6

_ImportError: symbol not found in flat namespace 'ndpi_category_get_name'

The steps I made:

  1. I downloaded the facebook.pcap from nfstream/tests/pcaps/ path from your repo
  2. I copied this code from your documentation:
from nfstream import NFStreamer

my_streamer = NFStreamer(source="facebook.pcap", # or live network interface
                         decode_tunnels=True,
                         bpf_filter=None,
                         promiscuous_mode=True,
                         snapshot_length=1536,
                         idle_timeout=120,
                         active_timeout=1800,
                         accounting_mode=0,
                         udps=None,
                         n_dissections=20,
                         statistical_analysis=False,
                         splt_analysis=0,
                         n_meters=0,
                         max_nflows=0,
                         performance_report=0,
                         system_visibility_mode=0,
                         system_visibility_poll_ms=100)
                         
for flow in my_streamer:
    print(flow)  # print it.

Desktop:

  • OS: macOS
  • Python version: 3.9.6
  • NFStream version: 6.5.3
@hos-arafat
Copy link

I have the same OS, Python and NFStream versions and I had the same error.

I fixed it by doing the following:

  1. Uninstalling nfstream using pip:
pip uninstall nfstream
  1. Building nfstream from source by following the instructions in the NFStream docs here:

Install the MacOS prerequisites:

brew install autoconf automake libtool pkg-config gettext json-c

Build NFStream from source:

git clone --recurse-submodules https://github.com/nfstream/nfstream.git
cd nfstream
python3 -m pip install --upgrade pip
python3 -m pip install -r dev_requirements.txt
python3 -m pip install .

I actually noticed that when the git clone --recurse-submodules https://github.com/nfstream/nfstream.git command runs, it clones into /nfstream/nfstream/engine/dependencies/nDPI. So I think building from source causes nDPI (the most likely source of the error) to build correctly.

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

2 participants