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

类似于前一篇博文,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:\Users\zou\Desktop\zbarlight\zbarlight-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)\ZBar\lib‘ ] ,
            include_dirs = [ ‘C:\Program Files (x86)\ZBar\include‘ ],
            optional=os.environ.get(‘READTHEDOCS‘, False),  # Do not build on Read the Docs
        ),
    ],

3、手工编译安装,成功:

C:\Users\zou\Desktop\zbarlight\zbarlight-1.2>python setup.py install
c:\python27\lib\distutils\extension.py:133: UserWarning: Unknown Extension options: ‘optional‘
  warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to src\zbarlight.egg-info\requires.txt
writing src\zbarlight.egg-info\PKG-INFO
writing top-level names to src\zbarlight.egg-info\top_level.txt
writing dependency_links to src\zbarlight.egg-info\dependency_links.txt
reading manifest file ‘src\zbarlight.egg-info\SOURCES.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 ‘src\zbarlight.egg-info\SOURCES.txt‘
installing library code to build\bdist.win32\egg
running install_lib
running build_py
running build_ext
building ‘zbarlight._zbarlight‘ extension
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall "-IC:\Program Files (x86)\ZBar\include" -Ic:\python27\include -Ic:\python27\PC -c src/zbarlight/_zbarlight.c -o build\temp.win32-2.7\Release\src\zbarlight\_zbarlight.o -std=c99
writing build\temp.win32-2.7\Release\src\zbarlight\_zbarlight.def
c:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win32-2.7\Release\src\zbarlight\_zbarlight.o build\temp.win32-2.7\Release\src\zbarlight\_zbarlight.def "-LC:\Program Files (x86)\ZBar\lib" -Lc:\python27\libs -Lc:\python27\PCbuild -Lc:\python27\PC\VS9.0 -llibzbar-0 -lpython27 -lmsvcr90 -o build\lib.win32-2.7\zbarlight\_zbarlight.pyd
creating build\bdist.win32
creating build\bdist.win32\egg
creating build\bdist.win32\egg\zbarlight
copying build\lib.win32-2.7\zbarlight\_zbarlight.c -> build\bdist.win32\egg\zbarlight
copying build\lib.win32-2.7\zbarlight\_zbarlight.pyd -> build\bdist.win32\egg\zbarlight
copying build\lib.win32-2.7\zbarlight\__init__.py -> build\bdist.win32\egg\zbarlight
byte-compiling build\bdist.win32\egg\zbarlight\__init__.py to __init__.pyc
creating stub loader for zbarlight\_zbarlight.pyd
byte-compiling build\bdist.win32\egg\zbarlight\_zbarlight.py to _zbarlight.pyc
creating build\bdist.win32\egg\EGG-INFO
copying src\zbarlight.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying src\zbarlight.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying src\zbarlight.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying src\zbarlight.egg-info\not-zip-safe -> build\bdist.win32\egg\EGG-INFO
copying src\zbarlight.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying src\zbarlight.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
writing build\bdist.win32\egg\EGG-INFO\native_libs.txt
creating dist
creating ‘dist\zbarlight-1.2-py2.7-win32.egg‘ and adding ‘build\bdist.win32\egg‘ to it
removing ‘build\bdist.win32\egg‘ (and everything under it)
Processing zbarlight-1.2-py2.7-win32.egg
removing ‘c:\python27\lib\site-packages\zbarlight-1.2-py2.7-win32.egg‘ (and everything under it)
creating c:\python27\lib\site-packages\zbarlight-1.2-py2.7-win32.egg
Extracting zbarlight-1.2-py2.7-win32.egg to c:\python27\lib\site-packages
zbarlight 1.2 is already the active version in easy-install.pth

Installed c:\python27\lib\site-packages\zbarlight-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:\python27\lib\site-packages
Searching for olefile==0.44
Best match: olefile 0.44
Adding olefile 0.44 to easy-install.pth file

Using c:\python27\lib\site-packages
Finished processing dependencies for zbarlight==1.2

-- END --

时间: 2024-11-03 03:33:24

windows平台python 2.7环境编译安装zbarlight的相关文章

windows平台python 2.7环境编译安装zbar

最近一个项目需要识别二维码,找来找去找到了zbar和zxing,中间越过无数坑,总算基本上弄明白,分享出来给大家. 一.zbar官方介绍 ZBar 是款桌面电脑用条形码/二维码扫描工具,支持摄像头及图片扫描,支持多平台,例如 iPhone,Andriod 手机,同时 ZBar封装了二维码扫描的 API 开发包. ZBar 目前条码类型有:EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. 从

OpenCV在Windows平台下的源码编译

OpenCV库官方网站为http://opencv.org/. 在该网站可以下载最新的OpenCV for Windows,例如当前我下载的是opencv-2.4.9.exe ,双击该文件解压到某个目录下,解压后的根目录为opencv,opencv目录下有2个子目录,分别为build和sources,build目录中存放的是已经编译好的库,而sources目录中存放的是源代码.下面我们会在sources目录中编译源代码. 在sources目录中可以看到有个CMakeLists.txt文件,这个文

LAMP环境编译安装(详细)

linux下Apache.mysql.php.phpMyadmin源码包编译安装及配置 事先可以先去各应用官网选择相应的源码包下载并上传到linux服务器上.源码包目录根据喜好或一个标准放置即可. 注:此文档仅适用于自己学习及测试使用,后续还将继续完善及解读文档中的不足. 在此之前先关闭selinux(Secrity-EnhancedLinux,安全增强式Linux),不然会由于selinux的安全机制影响到一些配置文件的加载及更改. 临时关闭(不用重启机器): setenforce 0 1.安

使用py2exe发布windows平台Python

一.简介 py2exe是一个将python脚本转换成windows上的可独立执行的可执行程序(*.exe)的工具,这样,你就可以不用装python而在windows系统上运行这个可执行程序.py2exe已经被用于创建wxPython,Tkinter,Pmw,PyGTK,pygame,win32com client和server,和其它的独立程序.py2exe是发布在开源许可证下的. 二.安装py2exe 从http://prdownloads.sourceforge.net/py2exe下载并运

Windows下Python,setuptools,pip,virtualenv的安装

#TITLE:Windows下Python,setuptools,pip,virtualenv的安装 #KEYWORDS: #DATE: Windows下Python,setuptools,pip,virtualenv的安装 Windows 2003平台,安装Python2.7.4,Python3.3,setuptools,pip,virtualenv. 安装Python2.7.4(当前版本是2.7.6),安装路径:C:\Python27 安装Python3.3.2,安装路径:C:\Python

windows下python web开发环境的搭建

windows下python web开发环境: python2.7,django1.5.1,eclipse4.3.2,pydev3.4.1 一. python环境安装 https://www.python.org/ftp/python/2.7/python-2.7.amd64.msi 不多说,装完后把C:\Python27加入到path环境变量里. 然后就溜溜python,看看version啦.OK,next step. 二. python web开发框架django安装 django是一个采用

python3的linux环境编译安装

python3的linux环境编译安装 1.linux下安装软件的方式 选则yum工具,方便,自行解决软件之间的依赖关系,自动下载且安装 1.配置yum源 可以选择阿里云源,清华源等 配置第一个仓库,里面有大量系统常用软件 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 配置第二个仓库,携带大量第三方软件(nginx,redis,mongodb,mairadb等) wge

Linux lamp环境编译安装

1.安装准备: 1)httpd-2.0.52.tar.gz 2)mysql-4.1.12.tar.gz 3)libxml2-2.6.27.tar 4)freetype-2.1.10.tar 5)gd-2.0.33.tar 6)jpegsrc.v6b.tar 7)libpng-1.2.16.tar 8)zlib-1.2.3.tar 9)freetds-0.64.tar.gz 10)php-4.3.9.tar.gz 11)phpMyAdmin292.tar.gz 12)ZendOptimizer-3

Windows 64 位 Matlab R2013a 环境下安装 libsvm

在这种环境下, 安装 libsvm 可以说是傻瓜似的了, 但就我搜出的 libsvm 安装教程来看, 以前的 libsvm 安装起来是有点麻烦的 目前最新版本是 libsvm 3.18, 按照 [1] 的描述, 将 libsvm 的 windows 目录放到 matlab 目录中, 我想博主说的这个目录应该不是 matlab 的当前工作目录, 而是 matlab 的搜索目录. 因为当前工作目录只有一个, 你把它设为 windows, 那么 libsvm 目录下的 heart_scale 数据集就