ffalcinelli / pydivert

A Python binding for WinDivert driver
GNU Lesser General Public License v3.0
200 stars 36 forks source link

AttributeError: module 'pydivert' has no attribute 'WinDivert' #31

Open ArijitM10 opened 6 years ago

ArijitM10 commented 6 years ago

I installed latest version of pydivert 2.1.0 . As per installation process it's mentioned Windivert will be inbuilt with this library, but I'm getting the above mentioned exception. Python version - 3.6.4 Operating System - Windows10

ffalcinelli commented 6 years ago

Yes WinDivert is bundled, this means the .dll and .sys files are installed among the pydivert binding itself. What you're getting is a python attribute error, could you share a piece of code? Especially the import statement.

ArijitM10 commented 6 years ago

import pydivert

Capture only TCP packets to port 80, i.e. HTTP requests.

w = pydivert.WinDivert("tcp.DstPort == 80 and tcp.PayloadLength > 0") w.open() # packets will be captured from now on packet = w.recv() # read a single packet print(packet) w.send(packet) # re-inject the packet into the network stack w.close() # stop capturing packets

This is the piece of code, yes i checked in python lib as well all the .dll and .sys files are there

JacobFrye-1 commented 5 years ago

Seems like the init.py in your pydivert folder got corrupted somehow. It was the only way I could reproduce the error...If you did anything special then pls tell. Try replacing with init.py the one in the master and see if the issue persists.