No module named 'scapy'

Hey, when I try to import scapy.all to pycharm for the network scanner project from the Learn Python & Ethical Hacking From Scratch course, I get the error no module named ‘scapy’. I’m using kali linux and when I try to install scapy from the terminal it says: Requirement already satisfied: scapy in /usr/lib/python3/dist-packages (2.5.0)

I’ve been trying tot fix this error for the last 3 hours but I still couldn’t fix it. Does anyone know how I can fix this error?

Thank you

Edit: I just found out I might be getting this error because I use python 3.11 and scapy doesn’t support this version. (Please correct me if i’m wrong) How do I change to an older python version so my pycharm can import scapy?

You can download older versions of Python from their website. And then use Pycharm interpreter settings to select that - Configure a system interpreter | PyCharm Documentation. I would suggest python 3.8 and it is still widely used.

1 Like