类似于前一篇博文,http://www.cnblogs.com/zhongtang/p/7148082.html中描述的情况。
编译zbarlight同样出现问题,简要处理步骤如下:
1、到https://pypi.python.org/pypi/zbarlight下载源文件。
File | Type | Py Version | Uploaded on | Size |
---|---|---|---|---|
zbarlight-1.2.tar.gz (md5) | Source | 2017-03-09 | 5KB |
2、解压到桌面目录,C:UserszouDesktopzbarlightzbarlight-1.2>
修改setup.py文件,增加红色字体三行内容,如下:
ext_modules=[ Extension( name=str('zbarlight._zbarlight'), sources=[str('src/zbarlight/_zbarlight.c')], extra_compile_args=['-std=c99'], libraries=['libzbar-0'], library_dirs= ['C:Program Files (x86)Barlib' ] , include_dirs = [ 'C:Program Files (x86)Barinclude' ], optional=os.environ.get('READTHEDOCS', False), # Do not build on Read the Docs ), ],
3、手工编译安装,成功:
C:UserszouDesktopzbarlightzbarlight-1.2>python setup.py install c:python27libdistutilsextension.py:133: UserWarning: Unknown Extension options: 'optional' warnings.warn(msg) running install running bdist_egg running egg_info writing requirements to srczbarlight.egg-info equires.txt writing srczbarlight.egg-infoPKG-INFO writing top-level names to srczbarlight.egg-info op_level.txt writing dependency_links to srczbarlight.egg-infodependency_links.txt reading manifest file 'srczbarlight.egg-infoSOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'docs' no previously-included directories found matching 'tests' warning: no previously-included files matching '*.py[cod]' found anywhere in distribution warning: no previously-included files matching '__pycache__' found anywhere in distribution warning: no previously-included files matching '*.so' found anywhere in distribution warning: no previously-included files found matching 'Makefile' warning: no previously-included files found matching 'requirements-dev.txt' warning: no previously-included files found matching 'tox.ini' writing manifest file 'srczbarlight.egg-infoSOURCES.txt' installing library code to builddist.win32egg running install_lib running build_py running build_ext building 'zbarlight._zbarlight' extension c:mingwingcc.exe -mno-cygwin -mdll -O -Wall "-IC:Program Files (x86)Barinclude" -Ic:python27include -Ic:python27PC -c src/zbarlight/_zbarlight.c -o build emp.win32-2.7Releasesrczbarlight\_zbarlight.o -std=c99 writing build emp.win32-2.7Releasesrczbarlight\_zbarlight.def c:mingwingcc.exe -mno-cygwin -shared -s build emp.win32-2.7Releasesrczbarlight\_zbarlight.o build emp.win32-2.7Releasesrczbarlight\_zbarlight.def "-LC:Program Files (x86)Barlib" -Lc:python27libs -Lc:python27PCbuild -Lc:python27PCVS9.0 -llibzbar-0 -lpython27 -lmsvcr90 -o buildlib.win32-2.7zbarlight\_zbarlight.pyd creating builddist.win32 creating builddist.win32egg creating builddist.win32eggzbarlight copying buildlib.win32-2.7zbarlight\_zbarlight.c -> builddist.win32eggzbarlight copying buildlib.win32-2.7zbarlight\_zbarlight.pyd -> builddist.win32eggzbarlight copying buildlib.win32-2.7zbarlight\__init__.py -> builddist.win32eggzbarlight byte-compiling builddist.win32eggzbarlight\__init__.py to __init__.pyc creating stub loader for zbarlight\_zbarlight.pyd byte-compiling builddist.win32eggzbarlight\_zbarlight.py to _zbarlight.pyc creating builddist.win32eggEGG-INFO copying srczbarlight.egg-infoPKG-INFO -> builddist.win32eggEGG-INFO copying srczbarlight.egg-infoSOURCES.txt -> builddist.win32eggEGG-INFO copying srczbarlight.egg-infodependency_links.txt -> builddist.win32eggEGG-INFO copying srczbarlight.egg-infonot-zip-safe -> builddist.win32eggEGG-INFO copying srczbarlight.egg-info equires.txt -> builddist.win32eggEGG-INFO copying srczbarlight.egg-info op_level.txt -> builddist.win32eggEGG-INFO writing builddist.win32eggEGG-INFO ative_libs.txt creating dist creating 'distzbarlight-1.2-py2.7-win32.egg' and adding 'builddist.win32egg' to it removing 'builddist.win32egg' (and everything under it) Processing zbarlight-1.2-py2.7-win32.egg removing 'c:python27libsite-packageszbarlight-1.2-py2.7-win32.egg' (and everything under it) creating c:python27libsite-packageszbarlight-1.2-py2.7-win32.egg Extracting zbarlight-1.2-py2.7-win32.egg to c:python27libsite-packages zbarlight 1.2 is already the active version in easy-install.pth Installed c:python27libsite-packageszbarlight-1.2-py2.7-win32.egg Processing dependencies for zbarlight==1.2 Searching for Pillow==4.0.0 Best match: Pillow 4.0.0 Adding Pillow 4.0.0 to easy-install.pth file Using c:python27libsite-packages Searching for olefile==0.44 Best match: olefile 0.44 Adding olefile 0.44 to easy-install.pth file Using c:python27libsite-packages Finished processing dependencies for zbarlight==1.2
-- END --