免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7777 | 回复: 0
打印 上一主题 下一主题

python中的pcap和dpkt两个模块学习 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-06 15:23 |只看该作者 |倒序浏览

                dpkt下载地址:http://code.google.com/p/dpkt/downloads/list 安装就行了
pcap下载地址:http://download.csdn.net/source/1852750   上CSDN下载频道下载的!好像没用再找找看:::http://code.google.com/p/pypcap/downloads/list 好像还是安装之后使用不了呀。郁闷
再找找看吧!
我直接从SF上面下载了代码下来然后进行编译python setup.py install结果报:
error: Python was built with Visual Studio version 7.1, and extensions need to b
e built with the same version of the compiler, but it isn't installed.
GOOGL了一下找到同样的一个问题:
(以下文章是:http://hi.baidu.com/heshuai64/blog/item/45031a32375e8bfe1a4cffe1.html)
一直都在Linux下工作,今天想在windows安装一个python模块,发生如下问题:
E:\Download\python\python-cjson-1.0.3>python setup.py install
running install
running build
running build_ext
building 'cjson' extension
error: Python was built with Visual Studio version 7.1, and extensions need to b
e built with the same version of the compiler, but it isn't installed.
google下发现一个解决方案:
I found an Alternate Solution by configuring MingW
Task:
RDFLib installation
Problem:   
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
Solution:
How to Configure Mingw:
* Download last release from http://prdownloads.sourceforge.net/mingw  (MinGW-5.1.3.exe)
* Run the file to start the installation process
* Keep all values at their defaults and select at least next components:
           o MinGW base tools
           o g++ compiler
           o MinGW Make
* Add the C:\mingw\bin directory to the system PATH
* Create (or edit) a .cfg file for distutils (distutils.cfg) eg: C:\Python25\Lib\distutils\distutils.cfg with this content:
  [build]
    compiler=mingw32
Then type in your RDFlib directory> python setup.py install
creating C:\Python25\Lib\site-packages\rdflib\store
copying build\lib.win32-2.5\rdflib\store\AbstractSQLStore.py -> C:\Python25\Lib\
site-packages\rdflib\store
copying build\lib.win32-2.5\rdflib\store\AuditableStorage.py -> C:\Python25\Lib\
site-packages\rdflib\store
copying build\lib.win32-2.5\rdflib\store\Concurrent.py -> C:\Python25\Lib\site-p
ackages\rdflib\store
....
....
....
Writing C:\Python25\Lib\site-packages\rdflib-2.3.3-py2.5.egg-info
Thats it Good Luck!
Further Source:  http://livingpyxml.python-hosting.com/wiki/AmaraWindowsInstallTips
试试看
E:\Download\python\python-cjson-1.0.3>python setup.py install
running install
running build
running build_ext
building 'cjson' extension
D:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -ID:\Python25\include -ID:\Pytho
n25\PC -c cjson.c -o build\temp.win32-2.5\Release\cjson.o
writing build\temp.win32-2.5\Release\cjson.def
creating build\lib.win32-2.5
D:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.5\Release\cjson.o
build\temp.win32-2.5\Release\cjson.def -LD:\Python25\libs -LD:\Python25\PCBuild
-lpython25 -lmsvcr71 -o build\lib.win32-2.5\cjson.pyd
running install_lib
copying build\lib.win32-2.5\cjson.pyd -> D:\Python25\Lib\site-packages
running install_egg_info
Writing D:\Python25\Lib\site-packages\python_cjson-1.0.3-py2.5.egg-info
成功
我的解决方法:
第一步:http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/download  去下载一个C语文编译器下来!
安装的目录在:C:\MinGW\bin
第二步:我上http://www.pdflib.com/download/pdflib-family/pdflib-7/ 去下载了一个pdflib包进来了。先下载下来看看吧!好像下载错了我昏S。。。
可参考的站:http://alimanfoo.wordpress.com/2008/04/12/installing-rdflib-on-windows-and-making-it-work-with-pydev/
介绍了rdflib的安装方法。
[build]
    compiler=mingw32
这里面写的格式要注意了 不能有空格。我一开始有空格结果就报错了
正确的写法应当是
[build]
compiler=mingw32
这样写才是正确的!
How to Configure Mingw:
* Download last release from http://prdownloads.sourceforge.net/mingw  (MinGW-5.1.3.exe)
* Run the file to start the installation process
* Keep all values at their defaults and select at least next components:
           o MinGW base tools
           o g++ compiler
           o MinGW Make
* Add the C:\mingw\bin directory to the system PATH
* Create (or edit) a .cfg file for distutils (distutils.cfg) eg: C:\Python25\Lib\distutils\distutils.cfg with this content:
  [build]
    compiler=mingw32
Then type in your RDFlib directory> python setup.py install
还没搞定。有没有N人可以帮我解决一下的呢谢谢了为什么我的pcap 模块安装不上?能帮我解决一下吗?谢谢了
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/84280/showart_2112270.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP