Scapy.all import * does not work

后端 未结 5 1009
遥遥无期
遥遥无期 2021-01-11 11:10

So, I wrote a little script in Ubuntu for scapy.

#!/usr/bin/env python
import sys
#from scapy.all import *
try 
   import scapy
   except ImportError:
              


        
5条回答
  •  时光取名叫无心
    2021-01-11 11:41

    I had a similar problem on OSX, I installed the scapy package pip install scapy and then I was trying to execute my test file scapy.py The error I got was :

    python scapy.py
    Traceback (most recent call last):
    File "scapy.py", line 1, in 
    from scapy.all import *
    File "/Users/**/Desktop/scapy-test/scapy.py", line 1, in 
    from scapy.all import *
    ModuleNotFoundError: No module named 'scapy.all'; 'scapy' is not a package
    

    In my case, it was the file name itself that caused the problem it can't be called scapy.py. I change it to test.py and all worked, it had nothing to do with the package location just the file name.

提交回复
热议问题