Netfilterqueue doesn't work in python 3

In the “Learn Python and Ethical Hacking from Scratch” course on the dns spoofer chapter i was doing fine. The assignment was to make the dns spoofer program compatible with python 3. The problem is: python 3 will not let me import netfilterqueue. It imported scapy fine. I’m confused on why netfilterqueue won’t work with python 3 and/or how to get to work with python 3.

I hoping someone has an answer to this question. This is a problem I’ve never encountered before. Thanks to anyone who even clicks on this post. Please put an answer if you can.

netfilterqueue doesn’t work with Python 3.7+. You have to downgrade your python version or create a new virtual environment and install python 3.6 or below on that.

how do I do that?

I’m trying to import python 3.6 into pycharm but i don’t know which file is the file im supposed to import to pycharm

sorry that it took me so long to answer. I was at my moms house for the weekend.

note: python3 will run python 3.8. python3.7 will run python 3.7. python3.8 will run python 3.8. every other python I tried (python3.1, python3.2, python3.3, etc.) would give an error saying that they weren’t commands (bash: (attempted command): command not found). This is the final assignment in section 7 of Zaid’s “Learn Python and Ethical Hacking from Scratch” course. This command is being run on the “kali linux 2020 customized by zsecurity vm”.

@Apurv-StationX is there another module that can replace netfilterqueue? I’m also having trouble downdrading my python.

does python 3.6.8 work?

I’m trying this with python 3.5.6

You have to first install a particular version of python and then only you can use it. Google on how you can install python 3.6. Also, I don’t think there is any replacement of netfilterqueue or I am not aware of it. Any python version below 3.7 should work. If it doesn’t then try looking through the Issues on their GitHub repo, you will get some answers to your problem. But if some issue is still open then you cannot do anything unless they fix it. https://github.com/kti/python-netfilterqueue/issues

I know how to install python. The problem is is that I don’t know which file is the one I can give to pycharm to use as an interprter

Installing python gives me a giant folder with hundreds of files. I don’t know which one is the one that runs python

When I check the files pycharm uses as interprters, they seem to be text files that I can’t open. They don’t look like the giant folder I got from installing python3.5.6. How do I install the python like how it is when it came with linux. Why does it give me a folder and not the wierd text file that the other functional pythons came as?

I’m really confused on how this works. Kali came with this single file called python2.7 and that is a finctional python. I don’t get that when I install python. How do I fix this>

I’ve tried pip install python3.6 and sudo apt-get install python3.6. what else is there to try?

I’ve also tried the official python website. Nothing will install it like the pythons that came with Kali Linux.

I always get stuck on the stupidest problems… guess it suits me since I’m the stupidest person.

I have never used pycharm so I don’t know how to configure that. Are you able to run that python version in terminal?

I am not able to use it in terminal