Owensteam
Owensteam

Reputation: 109

PyCharm does not import Scapy module

I am trying and failing to import scapy into python, which I have now been playing with for hours and all the google hits I get seem to make sense but when I try them - it fails.

first off I am using python3 and have that nicely in pycharm:

Correct Interpreter

I have also installed the package using pip3:

pip3 install scapy-python3

this appears in PyCharm as you can see in the picture. So I am now on a par with the other guides I found.

So finally I try:

from scapy import *

and for good measure

from scapy.all import *

which is for Python2 and 3k from what I read.

Could someone give me a hand, I don't know where to go next.

Gareth

Upvotes: 2

Views: 7869

Answers (3)

Rosalie B
Rosalie B

Reputation: 11

If you already installed Scapy (using pip install scapy) and want to import it in a PyCharm project, then from your open project window you can navigate to Settings -> Project: <your_project_name_here> -> Python Interpreter.

In this window you see a list of packages, click on the + button and search for scapy. You should see it. Click on it and click "Install Package" at the bottom of the window. That worked for me.

Note: this is specifically for a PyCharm project, NOT for the command line

Upvotes: 1

Cukic0d
Cukic0d

Reputation: 5421

Scapy-python3 is a different and outdated project.

The correct way to install scapy on python 3 is

pip3 install scapy

Or

python3 -m pip install scapy

Upvotes: 2

Babak Memar
Babak Memar

Reputation: 47

In some cases it is better to install scapy package for python2, too; by following command:

pip install scapy

try this.

Upvotes: 0

Related Questions