Chinaunix首页 | 论坛 | 博客
  • 博客访问: 29956820
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: Python/Ruby

2009-12-06 15:23:09

dpkt下载地址: 安装就行了
pcap下载地址: 上CSDN下载频道下载的!好像没用再找找看::: 好像还是安装之后使用不了呀。郁闷
再找找看吧!
我直接从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 (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:
试试看

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

成功

我的解决方法:
第一步:%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe/download  去下载一个C语文编译器下来!
安装的目录在:C:\MinGW\bin
第二步:我上 去下载了一个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 (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 模块安装不上?能帮我解决一下吗?谢谢了



阅读(5176) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-12-09 02:15:46

python setup.py build -c mingw32 生成的 build 直接拷贝到 site-packages 里面就可以了

wmjie2009-12-09 02:12:26

http://code.google.com/p/pypcap/downloads/list 这个是不是你要的东东?