• windows平台python 2.7环境编译安装zbarlight


    类似于前一篇博文,http://www.cnblogs.com/zhongtang/p/7148082.html中描述的情况。

    编译zbarlight同样出现问题,简要处理步骤如下:

    1、到https://pypi.python.org/pypi/zbarlight下载源文件。

    FileTypePy VersionUploaded onSize
    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 --

  • 相关阅读:
    ztree实现树的异步加载
    form submit提交遇到的问题
    js页面刷新常用的几种方式
    IE6下的按钮效果
    实现两个div并排的三种方式
    继续推荐Android12个自测源码
    优秀程序员实现向卓越程序员跨越
    面试那点事【面试题+面试技巧+职位推荐】
    Android 开发源码分享
    Android 亲测源码分享
  • 原文地址:https://www.cnblogs.com/zhongtang/p/7148236.html
Copyright © 2020-2023  润新知