ImportError: No module named all scapy

This topic contains 5 replies, has 4 voices, and was last updated by  m0wgli 6 years, 6 months ago.

  • Author
  • #8436

    Hey all,
    I google the above error without solution.kindly suggest how solve the problem.
    I studying with violent python book now.
    However on page 177 I got stucked!
    Here is my story, code and error message on mac osx 10.8.
    I run the code on the command line not backtrack.

    import re
    import optparse
    from scapy.all import *  
    def findCreditCard(pkt):
       raw = pkt.sprintf(‘%Raw.load%’)
       americaRE = re.findall(‘3[47][0-9]{13}’, raw)
       masterRE = re.findall(‘5[1-5][0-9]{14}’, raw)
       visaRE = re.findall(‘4[0-9]{12}(?:[0-9]{3})?’, raw)

       if americaRE:
           print ‘[+] Found American Express Card: ‘ + americaRE[0]
       if masterRE:
           print ‘[+] Found MasterCard Card: ‘ + masterRE[0]
       if visaRE:
           print ‘[+] Found Visa Card: ‘ + visaRE[0]

    def main():
       parser = optparse.OptionParser(‘usage %prog -i ‘)
       parser.add_option(‘-i’, dest=’interface’, type=’string’,
         help=’specify interface to listen on’)
       (options, args) = parser.parse_args()

       if options.interface == None:
           print parser.usage
           conf.iface = options.interface

           print ‘[*] Starting Credit Card Sniffer.’
           sniff(filter=’tcp’, prn=findCreditCard, store=0)
       except KeyboardInterrupt:

    if __name__ == ‘__main__’:
    my command line output:

    Traceback (most recent call last):
     File “/Users/user/Desktop/”, line 10, in
       from scapy.all import *  
     File “/Users/user/Desktop/”, line 10, in

       from scapy.all import *  
    ImportError: No module named all

    [Process completed]

    I installed  scapy 2.0.0 on python 2.7


  • #52941

    from scapy import *

  • #52942

    hmmm I had no issues running this as is on KALI. Adding to from scapy import * did generate an error.

  • #52943

    It’s a difference between versions.

  • #52944

    @ ajohnson
      from scapy import *
    The above statement output :
      ImportError: No module named all.

    See below:

    File “/Users/user/Desktop/”, line 3, in
        from scapy import * 
      File “/Users/user/Desktop/”, line 4, in
        from scapy.all import * 
    ImportError: No module named all

    Thanks for the reply and I am still stucked here

  • #52945

You must be logged in to reply to this topic.

Copyright ©2019 Caendra, Inc.

Contact Us

Thoughts, suggestions, issues? Send us an email, and we'll get back to you.


Sign in with Caendra

Forgot password?Sign up

Forgot your details?