0

I'm attempting to use the gganiminate library and I'm having an issue when I call gganimate::gganimate(myplot). The issue appears to be with a dependency library, magick.

When I call the function I get the following warning:

    gganimate::gganimate(p)

1: running command 'C:\WINDOWS\system32\cmd.exe /c convert --version' had status 4
2: In find_magic() : ImageMagick not installed yet!
 In im.convert(img.files, output = path.expand(movie.name),  ... :
  Please install ImageMagick first or put its bin path into the system PATH variable

So I try to install magick separately. I'm on a machine at a client so installing packages from github requires me to provide info to get through the firewall. I've installed other libraries from github with this machine using the same technique successfully. However, magick appears to be bumping into other problems. Below is my code and the error:

devtools::install_github("ropensci/magick",httr::set_config(httr::use_proxy("xx.xxx.xx.xx",xxxx)))

Downloading GitHub repo ropensci/magick@master
from URL https://api.github.com/repos/ropensci/magick/zipball/master
Installing magick
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R"  \
  --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  "C:/Users/r631265/AppData/Local/Temp/1/RtmpS0efnQ/devtools18fc5f2414b/ropensci-magick-7925af3"  \
  --library="C:/Users/r631265/Documents/R/win-library/3.4"  \
  --install-tests 

* installing *source* package 'magick' ...
** libs

*** arch - i386
rm -f RcppExports.o animation.o attributes.o base.o color.o composite.o config.o convolve.o device.o edit.o fonts.o options.o resize.o transformations.o magick.dll
Linking to imagemagagick-6.9.9
"C:/PROGRA~1/R/R-34~1.3/bin/i386/Rscript.exe" "../tools/winlibs.R" 6.9.9
Error in curl::curl_download(sprintf("https://github.com/rwinlib/imagemagick%s/archive/v%s.zip",  : 
  schannel: failed to receive handshake, SSL/TLS connection failed
Calls: <Anonymous> -> .Call
Execution halted
make: *** [winlibs] Error 1
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-34~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-34~1.3/share/make/winshlib.mk" CXX='$(CXX11) $(CXX11STD)' CXXFLAGS='$(CXX11FLAGS)' CXXPICFLAGS='$(CXX11PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX11LDFLAGS)' SHLIB_LD='$(SHLIB_CXX11LD)' SHLIB="magick.dll" OBJECTS="RcppExports.o animation.o attributes.o base.o color.o composite.o config.o convolve.o device.o edit.o fonts.o options.o resize.o transformations.o"' had status 2
ERROR: compilation failed for package 'magick'
* removing 'C:/Users/r631265/Documents/R/win-library/3.4/magick'
In R CMD INSTALL
Installation failed: Command failed (1)

I think perhaps my firewall details aren't getting passed into: curl::curl_download(sprintf("https://github.com/rwinlib/imagemagick%s/archive/v%s.zip",...)

Network security is a bit of a black box to me so I'm not sure what else to try or if I'm diagnosing the issue correctly. Any help would be greatly appreciated!

Mark Druffel
  • 629
  • 4
  • 10
  • When you install **ImageMagick** on Windows you **must** check the checkbox labelled `Install Legacy Tools` if you want to use the old `convert` command like your app apoears to want to do because `convert` was renamed `magick` at v7 of **ImageMagick**. Also, you must set your PATH so that **ImageMagick** `convert` is found **before** Windows `CONVERT.EXE` which converts FAT filesystems to NTFS or something. – Mark Setchell Feb 27 '18 at 20:01
  • @marksetchell Thanks Mark! I didn't even think to install image magick through Windows rather than R. Unfortunately, I still can't get the R library to install so gganimate tries to call the .exe file and gives an error "C:\Program' is not recognized as an internal or external command, operable program or batch file. an error occurred in the conversion... see Notes in ?im.convert Error in file(file, "rb") : cannot open the connection." – Mark Druffel Feb 27 '18 at 20:14
  • Ugh! I hate Windows. It looks like you are using a command with a space in its name and have omitted to surround the command with double quotes - but I'm only guessing. – Mark Setchell Feb 27 '18 at 20:42
  • hi @MarkDruffel, is there any particular reason why you are installing from github and not directly from cran? you might need to `Sys.setenv(https_proxy="proxyserver:proxyport")` – chinsoon12 Feb 28 '18 at 01:07
  • @chinsoon12 - Wow I feel dumb. I tried CRAN initially and got an error that the package didn't exist on my version of R so I assumed it was not a CRAN approved library. I must have spelled magick wrong because I just retried and it worked. Thank you and sorry to all for such a waste of time! – Mark Druffel Feb 28 '18 at 22:52

0 Answers0