1

I'm following the Machine learning tutorial made by Google Developer. When executing the command:

python -m scripts.retrain -h

I get the result:

> /usr/bin/python: No module named scripts

I tried to search for a result, and I get this from stackoverflow:

If you run

import os
os.getcwd() 

you'll see this is true. But what I get is this:

import-im6.q16: not authorized `os' @ error/constitute.c/WriteImage/1037.

What should I do to fix this?

Denton35
  • 11
  • 3
  • 1
    Are you running those command in an interactive python interpreter? It looks like you're trying to run them directly in your shell. – Patrick Haugh Dec 07 '18 at 20:22
  • Take a look at this answer: https://stackoverflow.com/questions/55558605/import-im6-q16-not-authorized-error-os-error-constitue-c-writeimage-1037-fo – Haddar Macdasi May 15 '19 at 09:26

1 Answers1

0

To fix it you have to update the policy for ImageMagick library.

Please check the settings in /etc/ImageMagick-6/policy.xml. There lots of policy rules and you can experiment with them to find the correct solution. For me, to solve import-im6.q16: not authorized error worked next settings:

 <policy domain="coder" rights="read | write" pattern="PS" />
 <policy domain="coder" rights="read | write" pattern="EPI" />
 <policy domain="coder" rights="read | write" pattern="PDF" />
 <policy domain="coder" rights="read | write" pattern="XPS" />

Initially these lines had rights attribute equal to none like this:

 <policy domain="coder" rights="none" pattern="PS" />