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.
Get the trial license.
Python 2/3
-
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
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
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/video
python rtsp.py
-
examples/camera
python camera.py
-
examples/command-line
python test.py