1

I am getting the following error when trying to sudo pip install scapy, can anyone help?

sudo pip install scapy
Collecting scapy
  Downloading scapy-2.3.3.tgz (1.4MB)
    100% |████████████████████████████████| 1.4MB 1.1MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-uuv1l4x3/scapy/setup.py", line 36
        os.chmod(fname, 0755)
                       ^
    SyntaxError: invalid token

    ----------------------------------------
TheTeaRex
  • 317
  • 5
  • 12
  • 1
    Did you mean `scrapy` or `scapy`? –  Nov 15 '16 at 21:58
  • 1
    Possible duplicate of [Scapy installation fails due to invalid token](http://stackoverflow.com/questions/32138575/scapy-installation-fails-due-to-invalid-token) – Luke Woodward Nov 15 '16 at 22:04

2 Answers2

0

If you meant to install scapy and not scrapy then you can follow this recommended guide to download it. I believe the pip package is not the recommended way of installation.

$ cd /tmp
$ wget scapy.net
$ unzip scapy-latest.zip
$ cd scapy-2.*
$ sudo python setup.py install
  • Unfortunately, it is not my script. I am not able to modify the script to use this method to install instead. As part of the script, it runs sudo pip install scapy. – TheTeaRex Nov 15 '16 at 22:11
0

Seems like this question has already been asked here ! Try fixing it using the recipes suggested, see if it works.

Community
  • 1
  • 1
weeCoder
  • 272
  • 2
  • 10
  • I do apologize, first off, I don't know how to modify to Oo755, as when I run the command, it creates a new temporary location and run setup.py. I am running off someone else's script which runs this command to install scapy, and it is working for other peoplse's machines. That's why I am trying to figure if there something else i can check, say I set up the environment wrong somehow? – TheTeaRex Nov 15 '16 at 22:07
  • @TheTeaRex I've just tried installing it on my pc and it errored out with the same message. The I tried `sudo pip2.7 install scapy` and it worked fine. I guess the problem is that the lib is not compatible with Python3 – weeCoder Nov 15 '16 at 22:14
  • @TheTeaRex Okay, would you please then post the part of the script responsible for installing the lib? – weeCoder Nov 15 '16 at 22:18
  • you are absolutely right, I assumed I was running pip2.7, but apparently that script was changing it to pip3.4. Thank you for your help! – TheTeaRex Nov 15 '16 at 22:44