Use err() instead of print "" for py3 compatibility

Commit 2988182a9ef43885ca161a384b919f4da4dc9347 broke python 3 compatibility by using a print statement. This uses the more appropriate err() function instead.