DanMcInerney / wifijammer

Continuously jam all wifi clients/routers
3.99k stars 782 forks source link

ImportError: No module named scapy.all #111

Closed codebyAbhishekBharti closed 1 year ago

codebyAbhishekBharti commented 3 years ago

When i am trying to execute the file using the the command: sudo python wifijammer also tried using sudo python2 wifijammer But it is returning the error: *Traceback (most recent call last): File "wifijammer", line 6, in from scapy.all import ImportError: No module named scapy.all**

but when I run the from scapy.all import in python interpreter* it is working fine.

SYSTEM DETAILS OS: Linux mint 20 Python 2.7.18

AcidOP commented 3 years ago

pip install --pre scapy[basic] This might help. Do let me know if it works.

codebyAbhishekBharti commented 3 years ago

pip install --pre scapy[basic] This might help. Do let me know if it works.

@acidOP Not working at all dear. Still getting ImportError: No module named scapy.all Fun fact:- If i am simply creating a python file check.py with just from scapy.all import * code in it and then run the file with python2 check.py then the module is getting imported successfully but if i apply sudo python2 check.py then it is saying the error ImportError: No module named scapy.all In short error is happening only when i am applying sudo to open the file else module is getting imported. But wifi jammer don't run without sudo.

AcidOP commented 3 years ago

Try installing scapy with sudo.

codebyAbhishekBharti commented 3 years ago

Try installing scapy with sudo.

If i am trying to install scapy with sudo using the command sudo pip install scapy it is saying sudo: pip: command not found where as if i am trying pip install scapy then it is saying Requirement already satisfied: scapy in /home/abhishek/.local/lib/python2.7/site-packages (2.4.4)

jubernar1993 commented 3 years ago

Did you find a fix for the issue? I’m stuck with that same error!

oldkingcone commented 3 years ago

what does $( which pip3 ) list | grep scapy produce

or

$( which pip2 ) list | grep scapy

irtizarana commented 3 years ago

I have also same error , plz help us

AhmadVakil commented 3 years ago

Same problem here...

JustVladKaz commented 3 years ago

Solution was in 16th issue!

thx @gconelhero - I just copy & paste... Here it is:

Digite no terminal: sudo mkdir /usr/lib/python2.7/dist-packages/scapy cd /usr/lib/python3/dist-packages/ cp -avr scapy/* /usr/lib/python2.7/dist-packages/scapy

Resolvido!

Type in the terminal: sudo mkdir /usr/lib/python2.7/dist-packages/scapy cd /usr/lib/python3/dist-packages/ cp -avr scapy/* /usr/lib/python2.7/dist-packages/scapy

Solved!

Fabriyin commented 3 years ago

Solution was in 16th issue!

thx @gconelhero - I just copy & paste... Here it is:

Digite no terminal: sudo mkdir /usr/lib/python2.7/dist-packages/scapy cd /usr/lib/python3/dist-packages/ cp -avr scapy/* /usr/lib/python2.7/dist-packages/scapy

Resolvido!

Type in the terminal: sudo mkdir /usr/lib/python2.7/dist-packages/scapy cd /usr/lib/python3/dist-packages/ cp -avr scapy/* /usr/lib/python2.7/dist-packages/scapy

Solved!

I tried this but didn't help, now I tried again but using "sudo" and finally worked

AsquzeRR commented 2 years ago

Solution was in the 16th issue!

thx @gconelhero - I just copy & paste... Here it is:

Digite no terminal: sudo mkdir /usr/lib/python2.7/dist-packages/scapy cd /usr/lib/python3/dist-packages/ cp -avr scapy/* /usr/lib/python2.7/dist-packages/scapy

Resolvido!

Type in the terminal: sudo mkdir /usr/lib/python2.7/dist-packages/scapy cd /usr/lib/python3/dist-packages/ cp -avr scapy/* /usr/lib/python2.7/dist-packages/scapy

Solved!

I tried the same thing but did not work for me, do you have another solution? every time I try to execute the python file with the scapy package he gives me this output: File "/home/kali/Desktop/python/scapy.py", line 2, in from scapy.all import File "/home/kali/Desktop/python/scapy.py", line 2, in from scapy.all import ModuleNotFoundError: No module named 'scapy.all'; 'scapy' is not a package

elrafinha64 commented 1 year ago

pip install --pre scapy[basic] This might help. Do let me know if it works.

@AcidOP Not working at all dear. Still getting ImportError: No module named scapy.all Fun fact:- If i am simply creating a python file check.py with just from scapy.all import * code in it and then run the file with python2 check.py then the module is getting imported successfully but if i apply sudo python2 check.py then it is saying the error ImportError: No module named scapy.all In short error is happening only when i am applying sudo to open the file else module is getting imported. But wifi jammer don't run without sudo.

I have exactly this same issue, Did you solved it?

AsquzeRR commented 1 year ago

Hi, how are you? I didn't solved it yet there are problem in python2 with scapy model i didnot understand the problem

gabeh33 commented 1 year ago

I had this problem because I was naming my file scapy.py and trying to run it using python scapy.py. That didn't work, but changing the name to just scapy, making it executable, and just running it with ./scapy seems to work

AsquzeRR commented 1 year ago

Heyy bro, i solved it by defining the scapy manually i find this soultion with my experience it was on windows not on kali linux, the problem is the python cannot define the sxapy.all as a package and it was installed, in as i read in that while happend a problem in scapy in windows i found a misconfiguration. Thanks bro❤️

AcidOP commented 1 year ago

@AsquzeRR Hey you mind creating a PR solving the misconfiguration? 😀

Dwebb22 commented 1 year ago

Tried nothing worked. Hey you have anything for start root?

Dee

On Sat, Feb 25, 2023, 12:09 AM Zeeshan @.***> wrote:

@AsquzeRR https://github.com/AsquzeRR Hey you mind creating a PR solving the misconfiguration? 😀

— Reply to this email directly, view it on GitHub https://github.com/DanMcInerney/wifijammer/issues/111#issuecomment-1445026694, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOEGDMWDL4DRAY7XY2522JTWZG44HANCNFSM4XMX3KWA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

gconelhero commented 1 year ago

What operating system are you working on?

AsquzeRR commented 1 year ago

the solution is simple, but I faced this problem on Windows 11, the solution is you must define the scapy in python3 in windows as the following: 1) reinstall scapy package via pycharm. 2) open CMD as administrator and install the scapy package by using the following command, where some files are missing from the scapy package in Pycharm and the pip3 will install the missed files. (and the same thing if you installed the scapy package via pip3 command and you did not install the scapy package in Pycharm. 3) you will get a green color to upgrade the pip command, you must upgrade it. 4) Enjoy <3

AsquzeRR commented 1 year ago

https://github.com/DanMcInerney/wifijammer/issues/111#issuecomment-1446313682 Solved!

Message ID: @.***>

anselmobattisti commented 1 year ago

I`m in a ubuntu 20.02 and running the script using virtual environment venv

after running inside the venv

pip install scapy

i got "ModuleNotFoundError: No module named 'scapy'"

After some analysis i understand that if you run pip install with a regular user AND run the script with root (required by scapy) the previously installed lib was available only to the user and not to the root. Because of that i needed to rerun the install process also with root.

sudo pip install scapy

after that all works!