在Windows上的Python 2.6中安装位数组 [英] Installing bitarray in Python 2.6 on Windows

查看:108
本文介绍了在Windows上的Python 2.6中安装位数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行python 2.6的Windows中安装 bitarray .

I would like to install bitarray in Windows running python 2.6.

我已安装mingw32,并且已将C:\Python26\Lib\distutils\distutils.cfg设置为:

I have mingw32 installed, and I have C:\Python26\Lib\distutils\distutils.cfg set to:

[build]
compiler = mingw32

如果我在cmd.exe窗口中键入:

C:\Documents and Settings\john\My Documents\bitarray-0.3.5>python setup.py install

我得到:

[normal python messages skipped]
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c bitarray/_bitarray.c -o build\temp.win32-2.6\Release\bitarray\_bitarray.o
bitarray/_bitarray.c:2197: error: initializer element is not constant
bitarray/_bitarray.c:2197: error: (near initialization for `BitarrayIter_Type.tp_getattro')
bitarray/_bitarray.c:2206: error: initializer element is not constant
bitarray/_bitarray.c:2206: error: (near initialization for `BitarrayIter_Type.tp_iter')
bitarray/_bitarray.c:2232: error: initializer element is not constant
bitarray/_bitarray.c:2232: error: (near initialization for `Bitarraytype.tp_getattro')
bitarray/_bitarray.c:2253: error: initializer element is not constant
bitarray/_bitarray.c:2253: error: (near initialization for `Bitarraytype.tp_alloc')
bitarray/_bitarray.c:2255: error: initializer element is not constant
bitarray/_bitarray.c:2255: error: (near initialization for `Bitarraytype.tp_free')
error: command 'gcc' failed with exit status 1

任何人都可以帮忙吗?

推荐答案

MingW无法编译位数组源,我尝试使用版本3.4.5并得到相同的错误. 但是,它可以使用Microsoft编译器进行编译.

MingW cannot compile the bitarray sources, I tried with version 3.4.5 and get the same errors. However, it compiles fine with the Microsoft compiler.

为方便起见,我为Python 2.6构建了msi和exe安装程序:

For your convenience I've build msi and exe installers for Python 2.6:

http://starship.python .net/crew/theller/bitarray-0.3.5.win32-py2.6.msi

http://starship.python .net/crew/theller/bitarray-0.3.5.win32-py2.6.exe

请让位数组作者指向他们,以便他可以将其上传到pypi.

Please point the bitarray author to them so that he can upload them to pypi.

这篇关于在Windows上的Python 2.6中安装位数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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