Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named pcapy #10

Closed
Maslor opened this issue Jan 12, 2017 · 21 comments
Closed

No module named pcapy #10

Maslor opened this issue Jan 12, 2017 · 21 comments

Comments

@Maslor
Copy link

Maslor commented Jan 12, 2017

After cloning the repo and installing the requirements with pip (scapy, specifically), I try to run the program (both in normal and sudo mode) and this is what I get. Do you know what I'm doing wrong?

python kickthemout.py 
Traceback (most recent call last):
  File "kickthemout.py", line 12, in <module>
    import scan, spoof
  File "/Users/Maslor/Desktop/kickthemout/scan.py", line 9, in <module>
    import scapy.config, scapy.layers.l2, scapy.route, socket, math, errno
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/layers/l2.py", line 16, in <module>
    from scapy.ansmachine import *
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/ansmachine.py", line 14, in <module>
    from scapy.sendrecv import send,sendp,sniff
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/sendrecv.py", line 14, in <module>
    from scapy.arch.consts import DARWIN, FREEBSD
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/arch/__init__.py", line 79, in <module>
    from scapy.arch.pcapdnet import *
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/arch/pcapdnet.py", line 328, in <module>
    import pcapy as pcap
ImportError: No module named pcapy

@k4m4
Copy link
Owner

k4m4 commented Jan 12, 2017

Try running sudo pip install -r requirements.txt.

@k4m4 k4m4 self-assigned this Jan 12, 2017
@k4m4 k4m4 added the question label Jan 12, 2017
@Maslor
Copy link
Author

Maslor commented Jan 12, 2017

Could not open requirements file: [Errno 2] No such file or directory: 'scapy'

@k4m4
Copy link
Owner

k4m4 commented Jan 12, 2017

Sorry, there was a typo in the command I shared with you. I fixed it now. Please give it another shot and let me know what happens.

@Maslor
Copy link
Author

Maslor commented Jan 12, 2017

Requirement already satisfied: scapy in ./lib/python2.7/site-packages (from -r requirements.txt (line 1))

I ran pip install pcapy and now, instead of complaining about the pcapy module, it's complaining about a dumbnet module.

@k4m4
Copy link
Owner

k4m4 commented Jan 12, 2017

Try doing:

$ sudo pip uninstall scapy
$ sudo pip install scapy

What OS are you running?

@Maslor
Copy link
Author

Maslor commented Jan 12, 2017

I'm running macOS Sierra version 10.12.2, python 2.7.13

After uninstalling and installing scapy I keep getting the pcapy module error. I installed the pcapy module and the message is as follows:

(kickthemout) Gabriels-MacBook-Pro:kickthemout Maslor$ python kickthemout.py 
Traceback (most recent call last):
  File "kickthemout.py", line 12, in <module>
    import scan, spoof
  File "/Users/Maslor/Desktop/kickthemout/scan.py", line 9, in <module>
    import scapy.config, scapy.layers.l2, scapy.route, socket, math, errno
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/layers/l2.py", line 16, in <module>
    from scapy.ansmachine import *
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/ansmachine.py", line 14, in <module>
    from scapy.sendrecv import send,sendp,sniff
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/sendrecv.py", line 14, in <module>
    from scapy.arch.consts import DARWIN, FREEBSD
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/arch/__init__.py", line 79, in <module>
    from scapy.arch.pcapdnet import *
  File "/Users/Maslor/Desktop/kickthemout/lib/python2.7/site-packages/scapy/arch/pcapdnet.py", line 471, in <module>
    import dumbnet as dnet
ImportError: No module named dumbnet

@k4m4
Copy link
Owner

k4m4 commented Jan 12, 2017

I see. Generally, there are quite a few issues when installing scapy on a Mac OS X. I would recommend doing $ sudo pip uninstall scapy and attempting to download it through homebrew: $ brew install scapy.

@Maslor
Copy link
Author

Maslor commented Jan 12, 2017

Ok, I think I know what my problem is. It seems that non-linux distributions require installing libpcap and libdnet and their Python wrappers.
But the brew version of scapy works, thanks!

@kanherepratik
Copy link

kanherepratik commented Jan 12, 2017

While running python kickthemout.py
ImportError: No module named scapy.config.
please help...!!

@k4m4
Copy link
Owner

k4m4 commented Jan 12, 2017

Hi there. It seems that you haven't installed the requirements. Try running: $ sudo pip install -r requirements.txt. What OS are you running? @kanherepratik

@thisisALPINE
Copy link

thisisALPINE commented Jan 13, 2017

I'm having the same exact issue. I'm running on a MacOsX, El Capitan. Firstly I entered sudo pip install -r requirements.txt, then I tried brew uninstall scapy and then brew install scapy, but when I run the program it keeps saying that the requirements are not satisfied.

@k4m4
Copy link
Owner

k4m4 commented Jan 14, 2017

Generally, scapy raises quite a few issues when it comes to Mac OS. @thisisALPINE
Try running the following:

$ pip uninstall scapy
$ brew uninstall scapy
$ brew install scapy

@k4m4
Copy link
Owner

k4m4 commented Jan 15, 2017

For Mac OS X Installations run the following:

Install Requirements:
----------------------
$ sudo pip install pcapy
$ brew install libdnet
$ brew install scapy
--> You might be asked to run some commands after executing the previous step.

Clone Repository:
------------------
$ git clone https://github.com/k4m4/kickthemout.git
$ cd kickthemout/
$ python kickthemout.py

NOTE: You need to have Homebrew installed before downloading requirements.

@k4m4
Copy link
Owner

k4m4 commented Jan 15, 2017

If you are running on Mac OS X, try the above solution & please let me know if the issue gets resolved. @thisisALPINE @kanherepratik @Maslor

@SentinelWarren
Copy link

SentinelWarren commented Jan 15, 2017

@k4m4, you can't install a python module with brew sir! cause it won't be installed installed as a module! inspect brew won't even be able to install scapy since its not in the formulae but in python/scapy tap.

@k4m4
Copy link
Owner

k4m4 commented Jan 15, 2017

I've tested and confirmed that you can use brew to install both scapy and libdnet. @SentinelWarren

@xdavidhu
Copy link
Collaborator

@SentinelWarren You can install python modules with brew. Take scapy for example.

@SentinelWarren
Copy link

SentinelWarren commented Jan 15, 2017

@k4m4 @xdavidhu sorry, i meant the module won't be on formulae but in homebrew/python/scapy python tap so was supposed to be something like brew install homebrew/python/scapy at least its how it works to me when i install python modules using brew!

@k4m4
Copy link
Owner

k4m4 commented Jan 15, 2017

That is correct. However, in some cases, brew install scapy works just fine. Otherwise, it will simply ask you to run a different command. @SentinelWarren

@gowrav
Copy link

gowrav commented Dec 29, 2017

Its apparently moved to a new tap > https://github.com/Homebrew/homebrew-python/pull/388
Homebrew/homebrew-core#1106

@k4m4
Copy link
Owner

k4m4 commented Dec 29, 2017

@gowrav pcapy doesn't seem to exist anymore on homebrew; use pip instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants