Get "NameError: name 'IP' is not defined" error message
<p>I try to run a python code from online course to create a raw network packet and send to a network by scapy with python 3.4.2 on Debian 9 but I got the error message as show below:</p>

<blockquote>
  <p>NameError: name 'IP' is not defined</p>
</blockquote>

<p>when I look into the code:</p>

<pre><code>#!/usr/bin/python

#for python 3 , must install scapy for python3 first by type command "pip3 install scapy-python3"
import scapy.all

frame = scapy.all.Ether(dst="15:16:89:fa:dd:09") / IP(dst="9.16.5.4") / TCP() / "This is my payload"
</code></pre>

<p>there is a red line under "IP" and "TCP" method and then It tell that those 2 methods are <code>Unresolved reference</code></p>

<p>I try to change how to import scapy library </p>

<pre><code>from

import scapy.all
</code></pre>

<p>to</p>

<pre><code>from scapy.all import *
</code></pre>

<p>but the problem is not resolved. What do I something wrong?</p>