为什么Mac上的scapy安装失败?

时间:2015-11-21 23:33:41

标签: python macos python-3.x scapy

当我尝试在Mac上安装scapy时,我收到此错误:

  Collecting scapy
  Downloading scapy-2.3.1.zip (1.1MB)
    100% |████████████████████████████████| 1.1MB 436kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/tmp/pip-build-f7vu4fsp/scapy/setup.py", line 35
        os.chmod(fname,0755)
                          ^
    SyntaxError: invalid token

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-f7vu4fsp/scapy

我尝试使用pip install scapypip3 install scapy

1 个答案:

答案 0 :(得分:8)

要为python3安装scapy,您必须运行pip3 install scapy-python3。只需pip3 install scapy将安装旧的2.x版本,这不兼容python3。