我试图用Python2.6.6安装Zbar,但是得到了很多错误--我试图删除它们,但仍然留下了一个,
当我试图用cmd安装zbar时,我得到了错误:
C:\zbar>python setup.py install
running install
running build
running build_ext
building 'zbar' extension
error: Unable to find vcvarsall.bat(我的c驱动器中有兹巴文件夹)不明白这在这页面中意味着什么“请注意:该模块将不会加载,除非ZBar库DLL (当前的libzbar-0.dll)可用在您的ZBar系统路径中!”所以我就把它留在原处。在环境变量路径中,我只添加了这些(可以吗?)
;C:\Python26;C:\MinGW\bin然后我下载了MinGW (选择了MinGW基本工具、g++编译器和MinGW make),在安装之后我得到了错误
error:unrecognized command line option ‘-mno-cygwin’
error: command ‘gcc’ failed with exit status 1然后我检查了gcc版本,它是4.8.1,我修改了Libs/disutils/cygwin编译器. in文件:
self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
compiler_so='gcc -mno-cygwin -mdll -O -Wall',
compiler_cxx='g++ -mno-cygwin -O -Wall',
linker_exe='gcc -mno-cygwin',
linker_so='%s -mno-cygwin %s %s'
% (self.linker_dll, shared_option,
entry_point))与.
self.set_executables(compiler='gcc -O -Wall',
compiler_so='gcc -mdll -O -Wall',
compiler_cxx='g++ -O -Wall',
linker_exe='gcc',
linker_so='%s %s %s'
% (self.linker_dll, shared_option,
entry_point))现在,当我再次尝试构建时,我得到了这个错误吗?
C:\zbar>setup.py install build --compiler=mingw32
running install
running build
running build_ext
building 'zbar' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c zb
armodule.c -o build\temp.win32-2.6\Release\zbarmodule.o
In file included from zbarmodule.c:24:0:
zbarmodule.h:26:18: fatal error: zbar.h: No such file or directory
#include <zbar.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
C:\zbar>我应该如何克服这个错误--请帮助我安装Zbar。也需要知道我是否应该使用Python2.7或2.6来更好地使用它。
发布于 2013-12-05 12:19:57
c:\Program Files\ZBar\bin\libzbar-0.dll的libzbar-0.dll添加到您的路径中。您还可以让它像这个答案Python26,Win32,ZBar - ImportError: DLL加载失败所描述的那样工作,而无需修改路径。https://stackoverflow.com/questions/20377293
复制相似问题