python pcap模块安装_python中的pcap和dpkt两个模块学习

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 模块安装不上?能帮我解决一下吗?谢谢了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值