I'm trying to import an image in Mathematica on my Raspberry Pi.

The code is simple but I get an error when importing:

$ wolfram
Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2014 Wolfram Research
Information & help: wolfram.com/raspi

In[1]:= SetDirectory["~/"];

In[2]:= i=Import["small.jpg"];
InstallJava::fail: A link to the Java runtime could not be established.

This is the image I'm trying to import: http://i.stack.imgur.com/zzSLr.jpg It's 1.5 MB large so the Pi should have no problem importing it. Why do I get this error and how can I prevent it?

UPDATE: I believe this is caused when the computer is running out of memory. I don't know a sure way to reproduce it but it keeps happening if I do other memory-intensive tasks on my Raspberry Pi. I'd like to know if there's a way to prevent this.

and I got this error:

/opt/Wolfram/WolframEngine/10.0/SystemFiles/Kernel/Binaries/Linux-ARM/WolframKernel: error while loading shared libraries: /opt/Wolfram/WolframEngine/10.0/SystemFiles/Libraries/Linux-ARM/libWolframEngine.so: cannot make segment writable for relocation: Cannot allocate memory

  • $\begingroup$ I don't have a Raspberry Pi so I can't reproduce this, but I presume you do actually have the JRE or JDK installed and usable...? $\endgroup$ – Oleksandr R. Apr 26 '14 at 12:46
  • $\begingroup$ I cannot reproduce this problem with either the November 19, 2013 version or the January 29, 2014 version. $\endgroup$ – bobthechemist Apr 26 '14 at 13:10
  • $\begingroup$ It seems imgur compressed the image, here is one uncompressed similar image: dropbox.com/s/v3hp98lgf31hm0r/small.jpg The problem is that sometimes I can import images just fine, but other times I get this error until I restart the Pi. $\endgroup$ – shrx Apr 26 '14 at 14:20
  • $\begingroup$ @shrx are you able to reproduce this problem with the most recent version of MMA on the RPi? $\endgroup$ – bobthechemist Nov 11 '14 at 3:22
  • $\begingroup$ @bobthechemist will test when I have the time, but my Pi occasionally still has problems with Mathematica, causing unresponsiveness and reboots. $\endgroup$ – shrx Nov 11 '14 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.