Closed makelove closed 6 years ago
Check for the ImageMagick policy file. ImageMagick does not have the proper permission set: /etc/ImageMagick-6/policy.xml
@pkarp0 How to set up ?
<policymap>
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<!-- <policy domain="resource" name="memory" value="2GiB"/> -->
<!-- <policy domain="resource" name="map" value="4GiB"/> -->
<!-- <policy domain="resource" name="area" value="1GB"/> -->
<!-- <policy domain="resource" name="disk" value="16EB"/> -->
<!-- <policy domain="resource" name="file" value="768"/> -->
<!-- <policy domain="resource" name="thread" value="4"/> -->
<!-- <policy domain="resource" name="throttle" value="0"/> -->
<!-- <policy domain="resource" name="time" value="3600"/> -->
<!-- <policy domain="system" name="precision" value="6"/> -->
<policy domain="cache" name="shared-secret" value="passphrase"/>
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
<policy domain="coder" rights="none" pattern="URL" />
<policy domain="coder" rights="none" pattern="HTTPS" />
<policy domain="coder" rights="none" pattern="MVG" />
<policy domain="coder" rights="none" pattern="MSL" />
<policy domain="coder" rights="none" pattern="TEXT" />
<policy domain="coder" rights="none" pattern="SHOW" />
<policy domain="coder" rights="none" pattern="WIN" />
<policy domain="coder" rights="none" pattern="PLT" />
<policy domain="path" rights="none" pattern="@*" />
</policymap>
comment out (or remove the line that reads)
<policy domain="path" rights="none" pattern="@*" />
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
Thank you ! it's Working.
No more error!
Thanks @pkarp0 works for me also
I am still getting this error even after removing the line? I am trying to run this on Google Colab. Any tips?
Havent worked with Colab. Try running ImageMagick directly. It is typically installed at /usr/bin/convert
I figured it out it had to be installed before importing moviepy
@alvisanovari Could you please tell me how you resolved it?
I tried to install ImageMagick in google colab even though it comes pre-installed like below but I am still getting permission issue.
!apt install imagemagick !pip install -r requirements.txt
error:
convert-im6.q16: not authorized @/tmp/tmpqujkrvch.txt' @ error/property.c/InterpretImageProperties/3516. convert-im6.q16: no images defined
PNG32:/tmp/tmpcewtbiuc.png' @ error/convert.c/ConvertImageCommand/3258..
.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect
install imagemagic: ! apt install imagemagick update the policy (see comments above about it) then import
Thank you for the reply @alvisanovari Just for anyone else who also need it for Google Colab or the local machine. I have uploaded the policy file here : policy.xml
So just use wget command to get the file and put it at /etc/ImageMagick-6/policy.xml location
The following code allows me to work with text via MoviePy from a fresh Google Colab instance.
!apt update &> /dev/null
!apt install imagemagick &> /dev/null
!apt install ffmpeg &> /dev/null
!pip3 install moviepy[optional] &> /dev/null
!sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
Here sed
is used to remove the line from the policy.xml
file.
Thanks @pkarp0 you made my day too :-)
It was more useful than the answer of other website
Thank you so much @rikhuijzer that worked perfectly on my container :+1:
Check for the ImageMagick policy file. ImageMagick does not have the proper permission set: /etc/ImageMagick-6/policy.xml
For what it's worth. When I did
cd /etc
ls
I could not find the ImageMagick-6 folder.
I had to do
cd /etc/ImageMagick-6
ls
Thanks for your help :)
The following code allows me to work with text via MoviePy from a fresh Google Colab instance.
!apt update &> /dev/null !apt install imagemagick &> /dev/null !apt install ffmpeg &> /dev/null !pip3 install moviepy[optional] &> /dev/null !sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
Here
sed
is used to remove the line from thepolicy.xml
file.
Thank you so much
The following code allows me to work with text via MoviePy from a fresh Google Colab instance.
!apt update &> /dev/null !apt install imagemagick &> /dev/null !apt install ffmpeg &> /dev/null !pip3 install moviepy[optional] &> /dev/null !sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml
Here
sed
is used to remove the line from thepolicy.xml
file.
Really Thanks!
Working for me
ubuntu 16.04 python3.6
export FFMPEG_BINARY='/usr/bin/ffmpeg' export IMAGEMAGICK_BINARY='/usr/bin/convert'
/usr/local/lib/python3.6/dist-packages/moviepy/tools.py in subprocess_call(cmd, verbose, errorprint) 48 verbose_print(errorprint, "\n[MoviePy] This command returned an error !") ---> 49 raise IOError(err.decode('utf8')) 50 else:
OSError: convert: not authorized
@/tmp/tmpatq66tt_.txt' @ error/property.c/InterpretImageProperties/3405. convert: no images defined
PNG32:/tmp/tmp4uy8drq2.png' @ error/convert.c/ConvertImageCommand/3210.During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)