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

Installation for Scapy-python3 (Scapy3k) #19

Closed
irvinhomem opened this issue Feb 23, 2016 · 2 comments
Closed

Installation for Scapy-python3 (Scapy3k) #19

irvinhomem opened this issue Feb 23, 2016 · 2 comments

Comments

@irvinhomem
Copy link

I tried to install scapy-http for scapy-python3 using:
pip3 install scapy-http

But it fails with some sort of python2 to 3 conversion issue related to how octals are represented:

Downloading scapy-2.3.2.tar.gz (1.1MB): 1.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/scapy/setup.py) egg_info for package scapy
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/scapy/setup.py", line 35
        os.chmod(fname,0755)
                          ^
    SyntaxError: invalid token
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/scapy/setup.py", line 35

    os.chmod(fname,0755)
                      ^
SyntaxError: invalid token

Not sure where exactly this happens.
NB: I have both Python2.7 and 3.4 installed and both scapy(2)and scapy3k installed respectively, with both working so far without a problem

@yarko
Copy link
Contributor

yarko commented Jun 21, 2016

This isn't octal conversion: it is a type failure (maybe it was tolerant in Python-2, but isn't in Python-3) -- see https://docs.python.org/3/library/os.html?highlight=os.chmod#os.chmod

The problem is this has a built-in dependency on scapy even if installing in Python-3 (which scapy won't work with anyway); if you clone and set the line:

install_requires=['scapy-python3'],

you should have a successful installation.

A solution to this may be to read the python version in setup.py, and set the appropriate package name (the import package is "scapy" in either case), e.g. something like:

import sys

scapy_name = "scapy-python3" if sys.version_info.major==3 else "scapy"
...
install_requires=[scapy_name],
...

I think that would do it.

yarko added a commit to yarko/scapy-http that referenced this issue Jun 21, 2016
invernizzi added a commit that referenced this issue Jun 24, 2016
Fixes #19: installation in Python-3
@alaa-aqeel
Copy link

sudo pip3 install scapy-python3

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

No branches or pull requests

3 participants