Good evening. I connected the pinject module to my script.

from pinject import IP, UDP 

I run the script error:

 File "./test.py", line 9, in <module> from pinject import IP, UDP ImportError: cannot import name IP 

How to fix the error?

    1 answer 1

    Most likely, you installed the pinject module with pip . Apparently, pip installs another module from its repository with the following name:

     $ pip search pinject pinject - A pythonic dependency injection library 

    And you need a module Pinject , Raw Packet Injection tool (judging by the imported classes IP and UDP ). It can be downloaded from the OffensivePython github repository and placed in the same directory as your script. Then the above classes are successfully imported.

    • I downloaded from the repository, threw it into the folder with the script. So what is next? How to install it? - JamesJGoodwin
    • and removed the one that was installed before? (if, of course, it was, as I suggested) If the downloaded module ( pinject.py ) is in the same place as the script, then nothing more needs to be done. - approximatenumber