title: Getting error: AttributeError: module 'nmap' has no attribute 'PortScanner'
body: <p>I have been seeking for answers of how to fix this Python problem:</p>
  <blockquote>
  <p>AttributeError: module 'nmap' has no attribute 'PortScanner'</p>
  </blockquote>
  <p>I wanted to learn more about port-scanning but I couldn't even install the module on Visual Studio Code, which I am using.  I've tried everything that I and many people can think of:</p>
  <ol>
  <li>Uninstalled and reinstalled  python-nmap as well as just nmap (since they are interconnected).</li>
  <li>I've tried renaming the module itself.</li>
  <li>I've launched my code on different IDEs</li>
  <li>I've created a separate folder and put modules and my project there.</li>
  </ol>
  <p>No success so far..</p>
  <p>This is my code:</p>
  <pre><code>import nmap
  
  
  nm = nmap.PortScanner()
  nm.scan('127.0.0.1', '22-443')
  </code></pre>
  <p>and the output:</p>
  <pre><code>/usr/local/bin/python3 /Users
  /user2132/Desktop/PYTHONProjects/portscannning.py
  Traceback (most recent call last):
  File &quot;/Users/user2132/Desktop/PYTHONProjects/portscannning.py&quot;, line 3, in &lt;module&gt;
  nm = nmap.PortScanner()
  AttributeError: module 'nmap' has no attribute 'PortScanner'
  </code></pre>
  <p>What can I try next?</p>
  <p>P.S. I am using MacOS</p>