RE: Can't import Scapy module
LE MOAL, REMY (REMY <remy.le_moal <at> alcatel-lucent.com>
2011-05-16 08:11:25 GMT
Hi,
To close the issue, I confirm that the problem with the ' from scapy.all import * ' statement is a problem with
my office configuration, I've tested at home still with Squeeze and it works like a charm. So, sorry for
that even if I'm still not able to tell you what's exactly the difference which cause that problem as even in
the rough way, purging and reinstalling the Py stuff, didn't solve the problem.
Anyway, thanks for your help Nathan :)
Cheers,
________________________________________
From: nmichaels <at> gmail.com [nmichaels <at> gmail.com] On Behalf Of Nathan Michaels [nathan <at> nmichaels.org]
Sent: Friday, May 13, 2011 3:46 PM
To: scapy.ml <at> secdev.org
Subject: Re: [scapy.ml] Can't import Scapy module
Hi Remy,
That's extremely odd. "import scapy" works but "from scapy.all import
*" gives you an ImportError?
I realized I have a server running Squeeze (6.0.1) and tried this:
sudo aptitude install python-scapy
That installed Scapy 2.1.0-1.
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from scapy.all import *
WARNING: No route found for IPv6 destination :: (no default route?)
>>>
So here's all I have left: purge Scapy (aptitude purge python-scapy)
and reinstall it. If that doesn't do it, there's probably something
wonky with your Python installation. I'd suggest purging and
reinstalling Python too, but that's pretty disruptive.
On Fri, May 13, 2011 at 4:19 AM, LE MOAL, REMY (REMY)
<remy.le_moal <at> alcatel-lucent.com> wrote:
> Hi Nathan,
>
> My config is :
> - /usr/share/pyshared/scapy -> present
> - echo $PYTHONPATH -> empty
> - I can do 'import scapy' in python ternminal but that's all, no possible to even do eg. a ' i = IP() ' ->
NameError: name 'IP' is not defined
> - and btw, my ' whereis scapy ' -> /usr/bin/scapy /usr/local/bin/scapy /usr/share/man/man1/scapy.1.gz
>
> Don't know if it's relevant for the problem..
> Anyway, have a good week-end !
>
> ________________________________________
> From: nmichaels <at> gmail.com [nmichaels <at> gmail.com] On Behalf Of Nathan Michaels [nathan <at> nmichaels.org]
> Sent: Thursday, May 12, 2011 6:09 PM
> To: scapy.ml <at> secdev.org
> Subject: Re: [scapy.ml] Can't import Scapy module
>
> I've got Scapy working on Sid right now, but I'm pretty sure I had
> squeeze on the last machine where I used it. Unfortunately, that was
> quite a while ago. Where is Scapy installed on your system? It's in
> /usr/share/pyshared/scapy on mine, and my PYTHONPATH is empty. Can you
> "import scapy"?
>
> On Thu, May 12, 2011 at 11:58 AM, LE MOAL, REMY (REMY)
> <remy.le_moal <at> alcatel-lucent.com> wrote:
>> Hi Michael,
>>
>> Thank you for your reply, so I tried your way ::
>> '#! /usr/bin python2.5'
>> or with :
>> '$ python2.5 myscript.py'
>>
>> But same ImportError : No module named all... arg, still stuck :S
>>
>> Btw, it was really hard to find on the web some helpful tips for that message error although some other
persons posted for the same problem. I tried as well to downgrade to Scapy v1 but was stuck in dependency
problems. Is there anybody who got Scapy v2 working on Squeeze ?
>>
>> Best regards,
>> Rémy
>>
>> ________________________________________
>> From: nmichaels <at> gmail.com [nmichaels <at> gmail.com] On Behalf Of Nathan Michaels [nathan <at> nmichaels.org]
>> Sent: Thursday, May 12, 2011 3:58 PM
>> To: scapy.ml <at> secdev.org
>> Subject: Re: [scapy.ml] Can't import Scapy module
>>
>> I suspect you have Scapy installed for Python 2.5, while your scripts
>> are running 2.6. Can you try explicitly putting 2.5 in your scripts'
>> #! line?
>>
>> On Thu, May 12, 2011 at 5:43 AM, LE MOAL, REMY (REMY)
>> <remy.le_moal <at> alcatel-lucent.com> wrote:
>>> Hi,
>>>
>>> I'm new to Scapy, I've been trying to use it to do some stress tests. It's actually working really fine
through the Scapy terminal, but I'm not able to make my scripts with the "from scapy.all import *" statement.
>>> The error message is : "ImportError: No module named all".
>>>
>>> I've been trying to install it both with 'apt-get' and the 'setup.py' python install way. NB : I'm on
Debian Squeeze, Scapy v.2, Python2.6 & Python2.5 installed.
>>>
>>> Would you have any suggestions to help me through ? Thank you very much.
>>> Have a good day,
>>>
>>>
>>> PS : Here is the python stuff I have on my machine, but I actually don't know if I'm missing something in
regards to the install requirements... :
>>>
>>> $ dpkg -l | grep python
>>>
>>> ii libpython2.6 2.6.6-8+b1 Shared Python runtime library (version 2.6)
>>> ii python 2.6.6-3+squeeze6 interactive high-level object-oriented language (default version)
>>> ii python-apt 0.7.100.1 Python interface to libapt-pkg
>>> ii python-apt-common 0.7.100.1 Python interface to libapt-pkg (locales)
>>> ii python-cairo 1.8.8-1+b1 Python bindings for the Cairo vector graphics library
>>> ii python-central 0.6.16+nmu1 register and build utility for Python packages
>>> ii python-chardet 2.0.1-1 universal character encoding detector
>>> ii python-dateutil 1.4.1-3 powerful extensions to the standard datetime module
>>> ii python-dbus 0.83.1-1 simple interprocess messaging system (Python interface)
>>> ii python-debian 0.1.18 Python modules to work with Debian-related data formats
>>> ii python-gconf 2.28.1-1 Python bindings for the GConf configuration database system
>>> ii python-glade2 2.17.0-4 GTK+ bindings: Glade support
>>> ii python-gnome2 2.28.1-1 Python bindings for the GNOME desktop environment
>>> ii python-gnupginterface 0.3.2-9.1 Python interface to GnuPG (GPG)
>>> ii python-gobject 2.21.4+is.2.21.3-1 Python bindings for the GObject library
>>> ii python-gtk2 2.17.0-4 Python bindings for the GTK+ widget set
>>> ii python-gtksourceview2 2.10.1-1 Python bindings for the GtkSourceView widget
>>> ii python-gtkspell 2.25.3-7 Python bindings for the GtkSpell library
>>> ii python-keybinder 0.2.2-2 registers global key bindings for applications - Python bindings
>>> ii python-libxml2 2.7.8.dfsg-2 Python bindings for the GNOME XML library
>>> ii python-matplotlib 0.99.3-1 Python based plotting system in a style similar to Matlab
>>> ii python-matplotlib-data 0.99.3-1 Python based plotting system (data package)
>>> ii python-minimal 2.6.6-3+squeeze6 minimal subset of the Python language (default version)
>>> ii python-numpy 1:1.4.1-5 Numerical Python adds a fast array facility to the Python language
>>> ii python-openssl 0.10-1 Python wrapper around the OpenSSL library
>>> ii python-pam 0.4.2-12.2 A Python interface to the PAM library
>>> ii python-pkg-resources 0.6.14-4 Package Discovery and Resource Access using pkg_resources
>>> ii python-pynetsnmp 0.28.14-1 Python ctypes bindings for NET-SNMP with Twisted integration
>>> ii python-pyorbit 2.24.0-6 A Python language binding for the ORBit2 CORBA implementation
>>> ii python-pyparsing 1.5.2-2 Python parsing module
>>> ii python-scipy 0.7.2+dfsg1-1 scientific tools for Python
>>> ii python-serial 2.3-1 pyserial - module encapsulating access for the serial port
>>> ii python-software-properties 0.60.debian-3 manage the repositories that you install software from
>>> ii python-stats 0.6-8 A collection of statistical functions for Python
>>> ii python-support 1.0.10 automated rebuilding support for Python modules
>>> ii python-tk 2.6.6-1 Tkinter - Writing Tk applications with Python
>>> ii python-twisted-bin 10.1.0-3 Event-based framework for internet applications
>>> ii python-twisted-core 10.1.0-3 Event-based framework for internet applications
>>> ii python-tz 2010b-1 Python version of the Olson timezone database
>>> ii python-uno 1:3.2.1-11+squeeze2 Python-UNO bridge
>>> ii python-vte 1:0.24.3-2 Python bindings for the VTE widget set
>>> ii python-xapian 1.2.3-3 Xapian search engine interface for Python
>>> ii python-xdg 0.19-2 Python library to access freedesktop.org standards
>>> ii python-zope.interface 3.5.3-1+b1 Interfaces for Python
>>> ii python2.5 2.5.5-11 An interactive high-level object-oriented language (version 2.5)
>>> ii python2.5-minimal 2.5.5-11 A minimal subset of the Python language (version 2.5)
>>> ii python2.6 2.6.6-8+b1 An interactive high-level object-oriented language (version 2.6)
>>> ii python2.6-minimal 2.6.6-8+b1 A minimal subset of the Python language (version 2.6)
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org
>
>
---------------------------------------------------------------------
To unsubscribe, send a mail to scapy.ml-unsubscribe <at> secdev.org