0

I'm trying to load a image in Julia but it gives me the error:

ERROR: UndefVarError: load not defined
Stacktrace:
1 top-level scope @ c:\folde1\folder2\project.jl

My code is:

using TestImages, Images, Statistics, Plots
a = load("rachado1.jpeg")

I'm running the code using vscode with Julia v1.9
I already tried installing many packages (FileIO, ImageIO, ImageMagick), but the error persists.

I also tried in colab following these instructions (Julia in colab) and adding a new cell using the script above. But I got the same error.

1
  • For load you would need FileIO and ImageIO, but not just installed, but imported. Try doing using ImageIO before the load. Commented Jun 12, 2023 at 22:56

1 Answer 1

2

as Dan Getz said, the issue is not importing FileIO:


# Try to load the image
img = load("test.jpg") # ERROR: UndefVarError: load not defined


using FileIO # now instead import FileIO first

img = load("test.jpg") # it now loads successfully

hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.