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

  • SEARCH
  • Home
  • 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 9266301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:17:11+00:00 2026-06-18T14:17:11+00:00

I installed scapy via MacPorts as recommended here in the official scapy documentation: http://www.secdev.org/projects/scapy/doc/installation.html#mac-os-x

  • 0

I installed scapy via MacPorts as recommended here in the official scapy documentation: http://www.secdev.org/projects/scapy/doc/installation.html#mac-os-x

It works just fine when I run scapy from the command-line.

However now I can’t seem to import scapy into the Python interpreter or in a python script, here’s the error.

Python 2.7.3 (default, Jan 31 2013, 22:54:33) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scapy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named scapy

I have also tried with Python2.5, doesn’t work either.

Python 2.5.6 (r256:88840, Aug  5 2011, 03:29:42) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scapy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named scapy

I think it has to do with the path somehow, but I don’t know where to edit those on Mac, especially that I installed scapy from MacPorts.

  • 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-06-18T14:17:12+00:00Added an answer on June 18, 2026 at 2:17 pm

    Macports installs everything to /opt/local. So I bet if you run /opt/local/bin/python, you’ll be able to import scapy.

    If you need scapy to be importable from the default Python installation, you’ll need to install it into that Python installation (instead of the other, Macports, Python installation).

    Relavent information from other answers:

    • Running Macports Python #1.
    • Running MacPorts Python #2.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just installed the py27-numpy package via MacPorts and python will not find the
EDIT: after reading this http://projects.scipy.org/numpy/ticket/1322 it seems that the NumPy version I am using
I have installed scapy 2.2.0 with macport. I imported it to my python code,
Did anyone successfully install apgl graph library for python? http://packages.python.org/apgl/ Is there other alternative
I have installed numpy1.3,scipy 0.7.1,matplotlib 0.99.1.1 and python 2.5 when I import pylab I
Installed both SonataMediaBundle, SonataNewsBundle and SonataAdminBundle (and much more but these matter). When posting
Installed rubyinstaller-1.8.7-p358.exe, then tried to install jammit , but the config.gem command isn't being
Installed a fresh Delphi xe2. Open a new project (vcl forms application). opened the
I installed Python 3.x (besides Python 2.x on Ubuntu) and slowly started to pair
I installed CLisp today on my Win7 PC. Please don't criticize my environment choices,

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.