Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Why wont this work?
Microsoft Windows [Version 10.0.17134.648]
(c) 2018 Microsoft Corporation. All rights reserved.

(venv) C:\Users\Mario\PycharmProjects\New Project 1>pip3 install nmap
Requirement already satisfied: nmap in c:\users\mario\pycharmprojects\new project 1\venv\lib\site-packages (0.0.1)
You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I'm trying to use nmap in a python script. When I try to install it, it says that I already have nmap installed... So it should work in my python script right? But it's not working. I get this error when I try to use nmap in a script:

(I have "import nmap" at the top of the script)

"C:\Users\Mario\PycharmProjects\New Project 1\venv\Scripts\python.exe" "C:/Users/Mario/PycharmProjects/New Project 1/"
Traceback (most recent call last):
  File "C:/Users/Mario/PycharmProjects/New Project 1/", line 3, in <module>
    ns = nmap.PortScanner()
AttributeError: module 'nmap' has no attribute 'PortScanner'

Process finished with exit code 1
It works in terminal but doesnt work in pycharm?... How do I get it to work in PyCharm?
(Mar-29-2019, 01:30 AM)ejected Wrote: It works in terminal but doesnt work in pycharm?... How do I get it to work in PyCharm?
You choose the same Python interpreter as in terminal.
So from cmd:
C:\>python -V
Python 3.7.2

C:\>pip -V
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)
So in this case i would Configure a Python interpreter to be pointing to Python 3.7.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Why wont this work :( Nonagon 2 457 Nov-03-2018, 03:38 AM
Last Post: wavic
  Boolean Wont Work fierygaming 5 918 Jun-13-2018, 07:49 PM
Last Post: fierygaming

Forum Jump:

Users browsing this thread: 1 Guest(s)