2013-02-24 195 views
0

我试图在BACKTRACK 5 R1虚拟机上安装pylorcon-1(Lorcon用于编写无线数据包的嗅探器的python包装)...我从[Pylorcon Official Page] [1]下载的软件包,有3个文件pylorcon.c,setup.py和tx.py ..所以作为README文件中给出我试图执行命令无法执行“python setup.py build”命令..!

python setup.py build 

执行上面的命令,我得到以下输出后:

running build 
running build_ext 
building 'pylorcon' extension 
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c pylorcon.c -o build/temp.linux-i686-2.6/pylorcon.o 
pylorcon.c:8:20: error: Python.h: No such file or directory 
pylorcon.c:9:26: error: structmember.h: No such file or directory 
pylorcon.c:10:21: error: tx80211.h: No such file or directory 
pylorcon.c:11:28: error: tx80211_packet.h: No such file or directory 
pylorcon.c:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:81: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:118: error: expected specifier-qualifier-list before ‘PyObject_HEAD’ 
pylorcon.c: In function ‘Lorcon_dealloc’: 
pylorcon.c:128: warning: implicit declaration of function ‘tx80211_getmode’ 
pylorcon.c:128: error: ‘Lorcon’ has no member named ‘in_tx’ 
pylorcon.c:129: warning: implicit declaration of function ‘tx80211_close’ 
pylorcon.c:129: error: ‘Lorcon’ has no member named ‘in_tx’ 
pylorcon.c:131: error: ‘Lorcon’ has no member named ‘ob_type’ 
pylorcon.c:131: error: ‘PyObject’ undeclared (first use in this function) 
pylorcon.c:131: error: (Each undeclared identifier is reported only once 
pylorcon.c:131: error: for each function it appears in.) 
pylorcon.c:131: error: expected expression before ‘)’ token 
pylorcon.c: At top level: 
pylorcon.c:136: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:151: error: expected declaration specifiers or ‘...’ before ‘PyObject’ 
pylorcon.c:151: error: expected declaration specifiers or ‘...’ before ‘PyObject’ 
pylorcon.c: In function ‘Lorcon_init’: 
pylorcon.c:152: error: ‘PyObject’ undeclared (first use in this function) 
pylorcon.c:152: error: ‘iface’ undeclared (first use in this function) 
pylorcon.c:152: error: ‘driver’ undeclared (first use in this function) 
pylorcon.c:152: warning: left-hand operand of comma expression has no effect 
pylorcon.c:153: error: ‘NULL’ undeclared (first use in this function) 
pylorcon.c:155: warning: implicit declaration of function ‘PyArg_ParseTupleAndKeywords’ 
pylorcon.c:155: error: ‘args’ undeclared (first use in this function) 
pylorcon.c:155: error: ‘kwds’ undeclared (first use in this function) 
pylorcon.c:161: warning: implicit declaration of function ‘Py_INCREF’ 
pylorcon.c:162: error: ‘Lorcon’ has no member named ‘iface’ 
pylorcon.c:162: warning: statement with no effect 
pylorcon.c:164: error: ‘Lorcon’ has no member named ‘driver’ 
pylorcon.c:164: warning: statement with no effect 
pylorcon.c:166: error: ‘Lorcon’ has no member named ‘drivertype’ 
pylorcon.c:166: warning: implicit declaration of function ‘tx80211_resolvecard’ 
pylorcon.c:166: warning: implicit declaration of function ‘PyString_AsString’ 
pylorcon.c:166: error: ‘Lorcon’ has no member named ‘driver’ 
pylorcon.c:166: warning: statement with no effect 
pylorcon.c:168: error: ‘Lorcon’ has no member named ‘drivertype’ 
pylorcon.c:168: error: ‘INJ_NODRIVER’ undeclared (first use in this function) 
pylorcon.c:169: warning: implicit declaration of function ‘PyErr_SetString’ 
pylorcon.c:169: error: ‘LorconError’ undeclared (first use in this function) 
pylorcon.c:173: warning: implicit declaration of function ‘tx80211_init’ 
pylorcon.c:173: error: ‘Lorcon’ has no member named ‘in_tx’ 
pylorcon.c:173: error: ‘Lorcon’ has no member named ‘iface’ 
pylorcon.c:174: error: ‘Lorcon’ has no member named ‘drivertype’ 
pylorcon.c:175: warning: implicit declaration of function ‘tx80211_geterrstr’ 
pylorcon.c:175: error: ‘Lorcon’ has no member named ‘in_tx’ 
pylorcon.c:179: warning: implicit declaration of function ‘tx80211_open’ 
pylorcon.c:179: error: ‘Lorcon’ has no member named ‘in_tx’ 
pylorcon.c:180: error: ‘Lorcon’ has no member named ‘in_tx’ 
pylorcon.c:183: warning: implicit declaration of function ‘tx80211_initpacket’ 
pylorcon.c:183: error: ‘Lorcon’ has no member named ‘in_packet’ 
pylorcon.c: At top level: 
pylorcon.c:191: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:196: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:201: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:269: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:297: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:310: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:327: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:372: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:422: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:455: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:496: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:502: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
pylorcon.c:523: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Lorcon_members’ 
pylorcon.c:527: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Lorcon_methods’ 
pylorcon.c:562: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘LorconType’ 
pylorcon.c:604: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pylorcon_methods’ 
pylorcon.c: In function ‘initpylorcon’: 
pylorcon.c:617: error: ‘PyObject’ undeclared (first use in this function) 
pylorcon.c:617: error: ‘m’ undeclared (first use in this function) 
pylorcon.c:617: error: invalid operands to binary * (have ‘char **’ and ‘char **’) 
pylorcon.c:617: warning: statement with no effect 
pylorcon.c:619: warning: implicit declaration of function ‘PyType_Ready’ 
pylorcon.c:619: error: ‘LorconType’ undeclared (first use in this function) 
pylorcon.c:622: warning: implicit declaration of function ‘Py_InitModule3’ 
pylorcon.c:622: error: ‘pylorcon_methods’ undeclared (first use in this function) 
pylorcon.c:623: warning: statement with no effect 
pylorcon.c:625: error: ‘NULL’ undeclared (first use in this function) 
pylorcon.c:628: error: ‘LorconError’ undeclared (first use in this function) 
pylorcon.c:628: warning: implicit declaration of function ‘PyErr_NewException’ 
pylorcon.c:628: warning: statement with no effect 
pylorcon.c:630: warning: implicit declaration of function ‘PyModule_AddObject’ 
pylorcon.c:633: error: expected expression before ‘)’ token 
pylorcon.c:633: error: invalid operands to binary * (have ‘char **’ and ‘char **’) 
error: command 'gcc' failed with exit status 1 

我该如何解决这个问题?

@Ric ......我执行命令sudo易于得到安装python-dev的那你告诉我,然后再执行命令蟒蛇的setup.py建立我得到了以下的输出:

运行建立
运行build_ext
建筑物pylorcon'延伸
GCC -pthread -fno严格走样-DNDEBUG -g -fwrapv -O2 -Wall -Wstrict的原型-fPIC -I/USR /包含/ python2。 6 -c pylorcon.c -o build/temp.linux-i686-2.6/pylorcon.o pylorcon.c:10:21:err或者:tx80211.h:没有这样的文件或目录
pylorcon.c:11:28:错误:tx80211_packet.h:没有这样的文件或目录
pylorcon.c:在函数 'capToList':
pylorcon.c: 20:错误:“TX80211_CAP_SNIFF”未声明(在此函数首先使用)

pylorcon.c:20:错误:(每个未声明的标识符仅报告一次
pylorcon.c:20:错误:对每个功能它出现在)
pylorcon.c:23:错误:'TX80211_CAP_TRANSMIT'未声明(首次在此函数中使用)

pylorcon.c:26:错误:'TX80211_CAP_SEQ'未声明在这个函数中使用)
pylorcon.c:29:错误: 'TX80211_CAP_BSSTIME' 未声明(在此函数首先使用)
pylorcon.c:32:错误: 'TX80211_CAP_FRAG' 未声明(在一次使用此功能)
pylorcon .c:35:error:'TX80211_CAP_CTRL'未声明(首次在此函数中使用)
pylorcon.c:38:错误:'TX80211_CAP_DURID'未声明(首次在此函数中使用)
pylorcon.c:41:error:' TX80211_CAP_SNIFFACK'未声明(在此函数中首次使用)
pylorcon.c:44:错误:'TX80211_CAP_SELFACK'未声明(首次在此函数中使用)
pylorcon.c:47:错误:'TX80 211_CAP_TXNOWAIT”未声明(在此函数首先使用)
pylorcon.c:50:错误: 'TX80211_CAP_DSSSTX' 未声明(在一次使用此功能)
pylorcon.c:53:错误: 'TX80211_CAP_OFDMTX' 未申报(先入此使用功能)
pylorcon.c:56:错误: 'TX80211_CAP_MIMOTX' 未声明(在此函数首先使用)
pylorcon.c:59:错误: 'TX80211_CAP_SETRATE' 未声明(在一次使用此功能)
pylorcon.c: 62:错误:'TX80211_CAP_SETMODULATION'未声明(首次在此函数中使用)
pylorcon.c:65:错误:'TX80211_CAP_NONE'未声明(首次在此函数中使用)
pylorcon。C:在函数 'pylorcon_getversion':
pylorcon.c:75:警告:在函数 'pylorcon_getcardlist'::
pylorcon.c:86:警告:函数 'tx80211_getversion'
pylorcon.c的隐式声明的隐式声明功能 'tx80211_getcardlist'
pylorcon.c:86:警告:分配使指针从整数,未作铸造
pylorcon.c:91:错误:解引用指针不完全型
pylorcon.c:96:错误:解引用指针不完整类型
pylorcon.c:103:错误:取消引用指向不完整类型的指针
pylorcon.c:105:错误:解引用指针不完全型
pylorcon.c:111:警告:函数 'tx80211_freecardlist'
pylorcon.c的隐式声明:在顶层:
pylorcon.c:119:错误:字段“in_tx具有不完整的类型
pylorcon.c:120:错误:字段 'in_packet' 具有
不完整的类型 pylorcon.c:在函数 'Lorcon_dealloc':
pylorcon.c:128:警告:的隐式声明函数'tx80211_getmode'
pylorcon.c:129:警告:隐式声明函数'tx80211_close'
pylorcon.c:在函数 'Lorcon_new':
pylorcon.c:142:错误: 'INJ_NODRIVER' 未声明(在此函数首先使用)
pylorcon.c:在函数 'Lorcon_init':
pylorcon.c: 166:警告:168::错误: 'INJ_NODRIVER' 未声明(在一次使用此功能)
pylorcon.c:173:警告:函数 'tx80211_init' 的隐式声明
函数 'tx80211_resolvecard'
pylorcon.c的隐式声明 pylorcon.c:175:警告:隐式声明函数'tx80211_geterrstr'
pylorcon.c:179:警告:函数'tx80211_open的隐式声明
pylorcon.c:183:警告:在函数 'Lorcon_getmode':的函数 'tx80211_initpacket'
pylorcon.c隐式声明
pylorcon.c:210:错误: 'TX80211_MODE_AUTO' 未声明(在一次使用此功能)
pylorcon.c:213:错误: 'TX80211_MODE_ADHOC' 未声明(在此函数首先使用)
pylorcon.c:216:错误: 'TX80211_MODE_INFRA' 未声明(在一次使用此功能)
pylorcon.c:219:错误:'TX80211_MODE_MASTER'未声明(首次在此函数中使用)
pylorcon.c:222:错误:'TX80211_MODE_REPEAT'未声明(首次在此函数中使用)
pylorcon.c:225:错误: 'TX80211_MODE_SECOND' 未声明(在此函数首先使用)
pylorcon.c:228:错误: 'TX80211_MODE_MONITOR' 未申报(第一在此函数使用)
pylorcon.c:在功能'Lorcon_setmode':
pylorcon.c:247:错误: 'TX80211_MODE_AUTO' 未声明(在此函数首先使用)
pylorcon.c:249:错误: 'TX80211_MODE_ADHOC' 未申报(第一在此函数使用)
pylorcon。 c:251:错误:'TX80211_MODE_INFRA'未声明(首次在此函数中使用)
pylorcon.c:253:错误:'TX80211_MODE_MASTER'未声明(首次在此函数中使用上)
pylorcon。C:255:错误: 'TX80211_MODE_REPEAT' 未声明(在此函数首先使用)
pylorcon.c:257:错误: 'TX80211_MODE_SECOND' 未声明(在一次使用此功能)
pylorcon.c:259:错误:“TX80211_MODE_MONITOR '未声明(第一在此函数使用)
pylorcon.c:在函数 'Lorcon_setfunctionalmode':
pylorcon.c:278:错误: 'TX80211_FUNCMODE_RFMON' 未声明(在此函数首先使用)
pylorcon.c:280:错误:'TX80211_FUNCMODE_INJECT'未声明(首次在此函数中使用)
pylorcon.c:282:错误:'TX80211_FUNCMODE_INJMON'未声明(首次在此函数中使用)
pylorcon.c:287:警告:在函数 'Lorcon_getchannel':功能 'tx80211_setfunctionalmode'
pylorcon.c隐式声明
pylorcon.c:300:警告:函数 'tx80211_getchannel'
pylorcon.c的隐式声明:在函数 'Lorcon_setchannel':
pylorcon.c:317:警告:在函数 'Lorcon_gettxrate':功能 'tx80211_setchannel'
pylorcon.c的隐式声明
pylorcon.c:329:警告:函数隐式声明'tx80211_gettxrate'
pylorcon.c:332:error:'TX80211_RATE_DEFAULT'undeclared(first u本身在此功能)
pylorcon.c:335:错误: 'TX80211_RATE_1MB' 未申报(先入该函数使用)
pylorcon.c:338:错误: 'TX80211_RATE_2MB' 未声明(在一次使用此功能)
pylorcon .C:341:错误: 'TX80211_RATE_5_5MB' 未声明(在此函数首先使用)
pylorcon.c:344:错误: 'TX80211_RATE_6MB' 未声明(在一次使用此功能)
pylorcon.c:347:错误: “TX80211_RATE_9MB”未申报(首次在此功能中使用)
pylorcon.c:350:错误:'TX80211_RATE_11MB'未申报(首次在此功能中使用)
pylorcon.c:353:错误:'TX80211 _RATE_24MB”未声明(在此函数首先使用)
pylorcon.c:356:错误: 'TX80211_RATE_36MB' 未声明(在一次使用此功能)
pylorcon.c:359:错误: 'TX80211_RATE_48MB' 未申报(先入此使用功能)
pylorcon.c:362:错误: 'TX80211_RATE_108MB' 未申报(在一次使用此功能)
pylorcon.c:在函数 'Lorcon_settxrate':
pylorcon.c:376:警告:函数隐式声明“ tx80211_getcapabilities'
pylorcon.c:376:error:'TX80211_CAP_SETRATE'undeclared(first use in this function)
pylorcon.c:386:error:'TX8021 1_RATE_DEFAULT”未声明(在此函数首先使用)
pylorcon.c:388:错误: 'TX80211_RATE_1MB' 未声明(在一次使用此功能)
pylorcon.c:390:错误: 'TX80211_RATE_2MB' 未申报(先入此使用功能)
pylorcon.c:392:错误: 'TX80211_RATE_5_5MB' 未声明(在此函数首先使用)
pylorcon.c:394:错误: 'TX80211_RATE_6MB' 未声明(在一次使用此功能)
pylorcon.c: 396:错误:'TX80211_RATE_9MB'未声明(首次在此函数中使用)
pylorcon.c:398:错误:'TX80211_RATE_11MB'未声明(首次在此函数中使用)
pylorcon。C:400:错误: 'TX80211_RATE_24MB' 未声明(在此函数首先使用)
pylorcon.c:402:错误: 'TX80211_RATE_36MB' 未声明(在一次使用此功能)
pylorcon.c:404:错误:“TX80211_RATE_48MB '未声明(在此函数首先使用)
pylorcon.c:406:错误: 'TX80211_RATE_108MB' 未声明(在一次使用此功能)
pylorcon.c:412:警告:功能的隐式声明 'tx80211_settxrate'
pylorcon .c:在函数'Lorcon_getmodulation'中:
pylorcon.c:425:警告:隐式声明函数'tx80211_getmodulation'
pylorcon.c:42 7:错误: 'TX80211_MOD_DEFAULT' 未声明(在此函数首先使用)
pylorcon.c:430:错误: 'TX80211_MOD_FHSS' 未声明(在一次使用此功能)
pylorcon.c:433:错误: 'TX80211_MOD_DSSS' 未申报(在一次使用此功能)
pylorcon.c:436:错误: 'TX80211_MOD_OFDM' 未声明(在此函数首先使用)
pylorcon.c:439:错误: 'TX80211_MOD_TURBO' 未申报(第一在此函数使用)
pylorcon.c:442:错误:'TX80211_MOD_MIMO'未声明(首次在此函数中使用)
pylorcon.c:445:错误:'TX80211_MOD_MIMOGF'未声明(首次在此函数中使用)
pylorcon.c:在函数 'Lorcon_setmodulation':
pylorcon.c:459:错误: 'TX80211_CAP_SETMODULATION' 未声明(在此函数首先使用)
pylorcon.c:469:错误: 'TX80211_MOD_DEFAULT' 未声明(第一次使用在此功能)
pylorcon.c:471:错误: 'TX80211_MOD_FHSS' 未声明(在一次使用此功能)
pylorcon.c:473:错误: 'TX80211_MOD_DSSS' 未声明(在一次使用此功能)
pylorcon.c :475:错误:'TX80211_MOD_OFDM'未声明(首次在此函数中使用)
pylorcon.c:477:错误:'TX80211_MOD_TURBO'未声明(首次在此函数中使用)
pylorcon.c:479:错误: 'TX80211_MOD_MIMO' 未声明(在此函数首先使用)
pylorcon.c:481:错误: 'TX80211_MOD_MIMOGF' 未声明(在一次使用此功能)
pylorcon.c:487:警告:函数 'tx80211_setmodulation' 的隐式声明
pylorcon.c:在函数 'Lorcon_txpacket':
pylorcon.c:514:警告:函数 'tx80211_txpacket'
错误的隐式声明:命令 'GCC' 失败,退出状态

+0

'locate python2.6'是否会在你的系统上返回任何东西?看起来这个软件包可能无法定位你的Python文件。在Ubuntu Linux中(只是在黑暗中拍摄),我执行命令“locate python 2.6”后,它们被包含在一个单独的软件包“python-dev” – 2013-02-24 04:45:08

+0

@Mike中。它显示了usr/local/lib/python2.6/dist-packages /,/usr/share/doc/python2.6/和/var/lib/dpkg/info/libpython2.6 ..所以我gess它找到正确的python .. whatsay ?? ?? – 2013-02-24 12:06:19

回答

3

您需要为您的操作系统安装所需的开发标头。

Building pylorcon2 page

$ sudo apt-get install libpcap-dev libnl-dev python-dev 

如果您仍然有问题,请按照这些指令的休息。

+0

@Ric ..我执行了命令“sudo apt-get install python-dev”,然后我再次执行了命令“python setup.py build”,这次我得到了一个不同的输出,但是出现了一些错误..(我已经提到了我的输出重新编辑后).. – 2013-02-24 12:08:21

+0

你有更多的东西来安装。我编辑了我的答案。线索是'tx80211.h:没有这样的文件或目录' – Ric 2013-02-24 19:40:25

+0

@Ric ... thanx很多兄弟。最后我明白了!你帮了我很多麻烦!非常感谢你!! – 2013-02-25 19:25:24