title: "installing" Kaitai Struct Python
body: <p>I need help with installing Kaitai Struct on my Laptop.</p>
  
  <p>I installed python-kaitaistruct and compiled the network files.</p>
  
  <p>But i get an import error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test2.py", line 1, in &lt;module&gt;
      from ethernet_frame import *
    File "/home/bene/python/ethernet_frame.py", line 15, in &lt;module&gt;
      from ipv6_packet import Ipv6Packet
    File "/home/bene/python/ipv6_packet.py", line 17, in &lt;module&gt;
      from ipv4_packet import Ipv4Packet
    File "/home/bene/python/ipv4_packet.py", line 17, in &lt;module&gt;
      from ipv6_packet import Ipv6Packet
  ImportError: cannot import name 'Ipv6Packet
  </code></pre>
  
  <p>My folder looks like this: </p>
  
  <pre><code>insgesamt 76K
  drwxr-xr-x  3 bene bene  330 19. Jan 16:03 .
  drwx------ 24 bene bene 4,0K 19. Jan 16:06 ..
  -rw-r--r--  1 bene bene   42  5. Jan 12:38 country.py
  -rw-r--r--  1 bene bene 8,0K  5. Jan 12:09 dns_packet.py
  -rw-r--r--  1 bene bene 1,6K  5. Jan 12:09 ethernet_frame.py
  -rw-r--r--  1 bene bene 3,0K  5. Jan 12:09 icmp_packet.py
  -rw-r--r--  1 bene bene 7,7K  5. Jan 12:09 ipv4_packet.py
  -rw-r--r--  1 bene bene 2,7K  5. Jan 12:09 ipv6_packet.py
  -rw-r--r--  1 bene bene 6,4K  5. Jan 12:09 microsoft_network_monitor_v2.py
  -rw-r--r--  1 bene bene 7,0K  5. Jan 12:09 pcap.py
  drwxr-xr-x  2 bene bene  180  5. Jan 12:12 __pycache__
  -rw-r--r--  1 bene bene 1,1K  5. Jan 12:09 tcp_segment.py
  -rw-r--r--  1 bene bene  518  5. Jan 12:32 test1.py
  -rw-r--r--  1 bene bene  596 19. Jan 15:56 test2.py
  -rw-r--r--  1 bene bene  667  5. Jan 12:38 test.py
  -rw-r--r--  1 bene bene  880  5. Jan 12:09 udp_datagram.py
  -rw-r--r--  1 bene bene  986  5. Jan 12:09 windows_systemtime.py
  </code></pre>
  
  <p>and the file i executed:</p>
  
  <pre><code>from ethernet_frame import *
  import socket
  
  s = socket.socket(socket.AF_PACKET,socket.SOCK_RAW,socket.ntohs(3))
  
  def network(buf):
      io = BytesIO(buf)
      ksio = KaitaiStream(io)
      pkt = EthernetFrame(ksio)
      dummy = pkt.ipv4_body.src_ip_addr
      print(dummy)
  
  while True:
      p = s.recvfrom(65565)
      network(p) 
  </code></pre>
  
  <p>Can someone help me maybe i installed it wrong?
  Or a Full Guide how to install and use it would be cool :DD</p>
  
  <p>Thank you &lt;3</p>