Skip to content
Build Python extension with Dynamsoft Barcode Reader.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Added a new sample supporting PIL image Jun 11, 2019
images Support DBR 6.3 Aug 20, 2018
src Added a new sample supporting PIL image Jun 11, 2019
.gitignore Added a new sample supporting PIL image Jun 11, 2019
LICENSE Initial commit Aug 7, 2018
README.md Updated README.md Jun 10, 2019

README.md

DBR Python Extension

Version 6.5.2

The repository aims to help developers build Python barcode apps with Dynamsoft Barcode Reader in Windows, Linux, macOS, and Raspberry Pi.

License

Get the trial license.

Contact Us

support@dynamsoft.com

Environment

Python 2/3

Installation

  • Dynamsoft Barcode Reader SDK.

  • OpenCV

    pip install opencv-python
    python3 -m pip install opencv-python
    

    For Raspberry Pi

    sudo apt-get install libopencv-dev python-opencv
    # Or
    sudo apt-get install python3-opencv
    
    
  • NumPy

    pip install numpy
    python3 -m pip install numpy
    

    For Raspberry Pi

    sudo apt-get install python-numpy
    # Or
    sudo apt-get install python3-numpy
    
    

HowTo

Windows

Set Visual Studio in cmd.exe. For example, Visual Studio 2015:

SET VS90COMNTOOLS=%VS140COMNTOOLS%

Edit setup.py. Replace the dbr_lib_dir and dbr_dll with yours:

dbr_lib_dir = r'e:\Program Files (x86)\Dynamsoft\Barcode Reader 6.5.2\Components\C_C++\Lib'
dbr_dll = r'e:\Program Files (x86)\Dynamsoft\Barcode Reader 6.5.2\Components\C_C++\Redist\x64\DynamsoftBarcodeReaderx64.dll'

Build and install the Python extension:

cd src
python setup.py build install
python3 setup.py build install

Linux, macOS and Raspberry Pi

Copy libDynamsoftBarcodeReader.so/libDynamsoftBarcodeReader.dylib to /usr/lib. If you don't have access to /usr/lib, try to copy the library to /usr/local/lib and set the LD_LIBRARY_PATH as follows:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Build and install the Python extension:

cd src
sudo python setup.py build install
sudo python3 setup.py build install

Examples

  • examples/video

    python rtsp.py
    
  • examples/camera

    python camera.py
    
  • examples/command-line

    python test.py
    

Related Articles

You can’t perform that action at this time.