Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6030469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:02:29+00:00 2026-05-23T05:02:29+00:00

i m trying to capture ethernet packet using pycap http://pycap.sourceforge.net/ . when i use

  • 0

i m trying to capture ethernet packet using pycap http://pycap.sourceforge.net/. when i use following command on python prompt with root privileges, it is working

>>>import pycap.capture
>>>p = pycap.capture.capture("wlan0")
>>>p.next()
(Ethernet(type=0x608, 00:1b:b1:46:53:5d -> ff:ff:ff:ff:ff:ff), ARP(op=0x1, protocol=0x800,     00:1b:b1:46:53:5d (192.16.68.10) -> 00:00:00:00:00:00 (192.16.110.39)), '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 1307898356.222398)

But if i run these commands as a script, i m getting following error

>>>sudo python pycap.py
Traceback (most recent call last):
  File "pycap.py", line 2, in <module>
  from pycap import *
  File "/home/nikhil/Code/Python/pycap.py", line 5, in <module>
  p = capture.capture(device)
  NameError: name 'capture' is not defined

Any suggestions?
pycap http://pycap.sourceforge.net/ says it is requires python2.3 and im using python2.6. Is that a problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:02:29+00:00Added an answer on May 23, 2026 at 5:02 am

    Your script using pycap is called pycap itself, so import pycap imports itself (. is usually the first directory on the import path). Because imports are caches, this doesn’t lead to infinite recursion but instead gives you a reference to your own module, which of course doesn’t define capture or anything else. Rename it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to capture shift + tab in c# using the following cpp syntax:
I'm trying to capture the output here. If, at the python prompt, I run
I trying to capture packets using SharpPcap library. I'm able to return the packets
I have a test list that I am trying to capture data from using
I am trying to capture screenshots on test failure using selenium-client and rspec. I
I am trying to capture img tag in HTML using Regex... So these must
I'm trying to capture an image from the window mobile device using Qt. Is
I am trying to capture an image of the screen for use in screencasting.
I'm trying to capture a url like the following in an intent: https://example.com/apple/orange?key=value I've
I'm trying to capture the output of my controller class (yii framework) the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.