# UndefVarError: imshow not defined

**URL:** <https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616>\
**Category:** General Usage\
**Created:** [July 3, 2017, 1:29pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616 "2017-07-03T13:29:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 1:29pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/1 "2017-07-03T13:29:14Z")

</div>

I’m having problems with a simple demo using JuliaImages. Here is what I get with Julia 0.5.2 and Jupyter:

```julia
Pkg.status("Images")
Pkg.status("TestImages")
Pkg.status("ImageView")

using TestImages, Images, ImageView
img = testimage("mandrill")
imshow(img)

```

returns

```julia
 - Images 0.5.14
 - TestImages 0.2.0
 - ImageView 0.2.0
UndefVarError: imshow not defined

```

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [July 3, 2017, 1:34pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/2 "2017-07-03T13:34:08Z")

</div>

The latest release of `ImageView` is 0.5.0, so try `Pkg.update()`ing your packages?

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 1:48pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/3 "2017-07-03T13:48:44Z")

</div>

I had. I’m getting:

```julia
INFO: Updating METADATA...
INFO: Updating Plots dev...
INFO: Computing changes...
INFO: No packages to install, update or remove

```

and still:

```julia
 - Images 0.5.14
 - TestImages 0.2.0
 - ImageView 0.2.0

```

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [July 3, 2017, 2:02pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/4 "2017-07-03T14:02:48Z")

</div>

Hm, maybe some package that depends on ImageView set an upper bound? Try `Pkg.dependents("ImageView")` and check the `REQUIRES` of the listed packages for upper bounds on `ImageView` and `Images` (since you have an old version of that too).

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 2:19pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/5 "2017-07-03T14:19:30Z")

</div>

Do you mean `requires` file in packages directory, like this one for `ImageRegistration` dependent of `ImageView`:

```julia
julia 0.4
Images
ImageView
FixedPointNumbers

```

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [July 3, 2017, 2:29pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/6 "2017-07-03T14:29:44Z")

</div>

Yes, exactly. There might be an entry

```julia
ImageView 0.1 0.2

```

somewhere, which might indicate a lower bound of 0.1 and an upper bound of 0.2.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 3, 2017, 2:35pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/7 "2017-07-03T14:35:44Z")

</div>

It should display automatically.

 ![](https://global.discourse-cdn.com/julialang/original/3X/8/6/86a589245208ca90046154c5acb08d2b2c96fa0f.png)

(Julia v0.6.)

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 2:40pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/8 "2017-07-03T14:40:59Z")

</div>

Yes, `ActiveAppearanceModels` has this:

```julia
Docile 0.4
StatsBase 0.6
Images 0.4
ImageView 0.1
Colors
FixedPointNumbers 0.0.7
VoronoiDelaunay
MultivariateStats 0.2
MAT 0.2
PiecewiseAffineTransforms 0.1
FaceDatasets 0.1

```

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 3, 2017, 2:45pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/9 "2017-07-03T14:45:37Z")

</div>

Automatic display works fine. I was going through a tutorial, which used `imshow`.

I was trying to find a method to display both 2D and 3D images. Automatic display doesn’t handle 3D images, but `ImageView.view` seems to display both just fine.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [July 4, 2017, 8:51pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/10 "2017-07-04T20:51:36Z")

</div>

Can you post the results of `Pkg.status()` either here or to a [gist](https://gist.github.com/)? There’s some dependency which is preventing you from getting anything resembling recent releases of the JuliaImages suite. For example, the [documentation](http://juliaimages.github.io/latest/) will be all wrong for you.

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [July 4, 2017, 10:53pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/11 "2017-07-04T22:53:07Z")

</div>

Here is the result of `Pkg.status()`:  
[https://gist.github.com/pauljurczak/159ac806766f17cb2af56090b50c84fb](https://gist.github.com/pauljurczak/159ac806766f17cb2af56090b50c84fb)

I was trying a few visualization and plotting packages, so there may be some unusual dependencies there.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 4, 2017, 11:22pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/12 "2017-07-04T23:22:18Z")

</div>

You’re on an old dev branch of Plots.jl. Probably not causing your issue, but you should probably `Pkg.free()`.

What @pfitzseb is looking for is version bounds. @pauljurczak when there’s only one number that’s a lower bound: that should be okay. The issue is if there was

```julia
ImageView 0.1 0.2

```

That would prevent it from upgrading beyond 0.2. But since other packages like Optim are on exceedingly old releases as well, something tells me there’s a deeper problem here.

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [July 4, 2017, 11:31pm UTC](https://discourse.julialang.org/t/undefvarerror-imshow-not-defined/4616/13 "2017-07-04T23:31:14Z")

</div>

As Chris says, `Pkg.free("Plots")` is definitely the first thing to try. Notice that `dev` branch you’re on, most likely that is causing the problem.

If that doesn’t help, you could also try `Pkg.pin("ColorTypes", v"0.5.1")` (the current release) and then see what conflicts `Pkg.update` reports. That might give you some hint about what’s keeping you back from recent releases.

If you don’t have any unpushed commits, one _drastic_ option is to make a copy of your `~/.julia/v0.5/REQUIRE` file, then nuke your `~/.julia/v0.5` directory, then do `Pkg.init()`, copy your backup of your `REQUIRE` file into your shiny new `~/.julia/v0.5`, and then do `Pkg.update()`.

But like I said, only do this if you are certain that you don’t have any local changes to any packages. And it might not work if the problem is that something about your combination of packages causing problems.
