pythonpython-3.xwindowsnmap

Python Nmap module not found despite already being installed


I am trying to write a port scanning program as part of my course assignment. However, even after downloading Nmap, an error appeared. It says 'nmap' is not accessed by pylance. I cannot access it interactive mode either. I am still very new to programming so any form of help will be much appreciated As you can see here Nmap is already downloaded. But... And...

I tried deleting and re-installing Nmap, that did not work. I searched YouTube for solutions, but a lot of the files and programs they had I did not. I have already downloaded nmap from the website too.


Solution

  • Maybe that happened because you have many interpreter and you installing in another interpreter to fix that you need to change the interpreter you can see the documentation in https://code.visualstudio.com/docs/python/environments
    or you can try using python venv by write this command in your terminal

    python -m venv venv
    

    after that activate the venv and activate the venv

    .\venv\Scripts\activate
    

    after you activate the venv you just need to install the nmap

    pip install python-nmap
    

    I hope this answer can solve your problem