Skip to content

Latest commit

 

History

History
99 lines (71 loc) · 2.5 KB

README.md

File metadata and controls

99 lines (71 loc) · 2.5 KB

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

[email protected]

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
    
  • NumPy

    pip install numpy
    python3 -m pip install 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