由于令牌无效,Scapy安装失败 [英] Scapy installation fails due to invalid token

查看:110
本文介绍了由于令牌无效,Scapy安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始学习网络,我想安装scapy. 我已经下载了最新版本(2.2.0),并且在我的计算机上安装了python的两个版本-2.6.1和3.3.2.我的操作系统是Windows 7 64位.

I have recently taken up learning networks, and I want to install scapy. I have downloaded the latest version (2.2.0), and have two versions of python on my computer- 2.6.1 and 3.3.2. My OS is windows 7 64 bit.

提取scapy并导航到终端中的正确文件夹后,系统指示我运行"python setup.py install".我收到以下错误-

After extracting scapy and navigating to the correct folder in the terminal, I was instructed to run "python setup.py install". I get the following error-

文件"setup.py",第35行
os.chmod(fname,0755)
................................ ^
......................无效的 令牌

File "setup.py", line 35
os.chmod(fname,0755)
................................^
......................invalid token

(对齐点)

如何解决此问题?

推荐答案

更新:不推荐使用scapy-python3(2018),并且将不再更新. scapy>=2.4.0已合并python 3兼容性.

Update: scapy-python3 is deprecated (2018) and will no longer be updated. scapy>=2.4.0 has merged python 3 compatibility.

最新的安装方法是

pip3 install scapy>=2.4.0

您可以查看文档中的安装页面用于其他安装方法

You may check the installation page in the documentation for other installation methods

原始答案:

也许您正在尝试为Python 2安装scapy软件包,但对于Python 3需要一个.

Perhaps you are trying to install the package scapy for Python 2, but you need the one for Python 3.

pip install scapy 

出现此错误:

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

同时

pip3 install scapy-python3

安装正确.

此错误意味着Python 3无法识别八进制数,请参见 PEP 3127 :

This error means the octal number is not recognized by Python 3, see PEP 3127:

八进制文字现在必须以"0o"或"0O"开头而不是"0"来指定;

octal literals must now be specified with a leading "0o" or "0O" instead of "0";

这篇关于由于令牌无效,Scapy安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆