1. libdmtx Installation
libdmtx must be installed on your system before trying to install and run the Python wrapper. Refer to the General Instructions for this.
2. pydmtx Installation
At the moment (version 0.7.4) the wrappers are not released as a package on the sourceforge page (http://sourceforge.net/mailarchive/message.php?msg_id=27861772).
Get dmtx-wrappers from
$ git clone git://libdmtx.git.sourceforge.net/gitroot/libdmtx/dmtx-wrappers
After libdmtx is present, next install pydmtx by running the following command as root:
$ python setup.py install
Once installed, you can verify it works by running as yourself:
$ python test.py
3.1. ImportError: libdmtx.so.0: cannot open shared object file
This error indicates it is not able to find the libdmtx library. There are a few ways to fix this. You can make a temporary local session fix:
$ export LD_LIBRARY_PATH=/usr/local/lib
… or make a permanent fix that requires root privileges:
$ /sbin/ldconfig /usr/local/lib
Alternatively, you could edit /etc/ld.so.conf to include /usr/local/lib (which also requires root privileges).
When it is working properly the test.py script should create an image named 'hello.png' in the current directory. The image should be a Data Matrix barcode that scans to "hello, world".
3.2. SystemError: NULL result without error in PyObject_Call
Could mean that you're passing in a 1 bit b/w image instead of a RGB image. This is a good guard against that.
img = Image.open( f ) if img.mode != 'RGB': img = img.convert('RGB') print dm_read.decode( img.size, img.size, buffer(img.tostring()) )
These packages are required to install and run pydmtx:
If you are using an RPM-based system then you can test for the following packages:
5. Anything Else?
Is something missing from these instructions? If you spent hours searching for a solution that you feel should be included here then please update this page directly.
[Add your documentation here…]
6. This Document
Updates to this page ultimate feed into the wrapper/python/README file that is distributed with the source package. If you are looking for information specific to an older release, please refer to this file as it exists in that package version.