Skip to content Skip to sidebar Skip to footer

Import Error In Python 3.6 With Sudo?

I have written a program that uses Scapy. Python is able to import the scapy module perfectly but using sniff function of scapy requires running the program as administrator. Howev

Solution 1:

As using python3, I would recommend

sudo python3 -m pip install scapy

Of course pyenv works too I'd you're familiar with it.

Solution 2:

You can fix it with:

$ sudo pip install scapy

And then try again.

I would recommend using virtualenv to run your program though. Instead of installing package after package in your main environment.

Post a Comment for "Import Error In Python 3.6 With Sudo?"