# Using PyPlot .. ERROR: InitError: PyError .. matplotlib could not be found by pyimport

**URL:** https://discourse.julialang.org/t/using-pyplot-error-initerror-pyerror-matplotlib-could-not-be-found-by-pyimport/14561
**Category:** New to Julia
**Created:** [September 5, 2018, 1:30am UTC](https://discourse.julialang.org/t/using-pyplot-error-initerror-pyerror-matplotlib-could-not-be-found-by-pyimport/14561 "2018-09-05T01:30:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![douglaskbell](https://avatars.discourse-cdn.com/v4/letter/d/85e7bf/32.png) [@douglaskbell](https://discourse.julialang.org/u/douglaskbell)
#### Post date: [September 5, 2018, 1:30am UTC](https://discourse.julialang.org/t/using-pyplot-error-initerror-pyerror-matplotlib-could-not-be-found-by-pyimport/14561/1 "2018-09-05T01:30:13Z")

</div>

After installation of Julia 1.0.0 on Windows 10, and installation of anaconda python,  
in Julia REPL the following causes error:

```julia
using Pkg

Pkg.add("PyPlot")

using PyPlot

```

The full log and error is………………………………….

```nohighlight
  _ _ _(_)_ | Documentation: https://docs.julialang.org
 (_) | (_) (_) |
  _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
 | | | | | | |/ _` | |
 | | |_| | | | (_| | | Version 1.0.0 (2018-08-08)
_/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using Pkg

julia> Pkg.add("PyPlot")
 Updating registry at `C:\Users\douglaskbell\.julia\registries\General`
 Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
 Updating `C:\Users\douglaskbell\.julia\environments\v1.0\Project.toml`
[no changes]
 Updating `C:\Users\douglaskbell\.julia\environments\v1.0\Manifest.toml`
[no changes]

julia> using PyPlot
[ Info: Installing matplotlib via the Conda matplotlib package...
[ Info: Running `conda install -y matplotlib` in root environment
Solving environment: done

# All requested packages already installed.

ERROR: InitError: PyError (PyImport_ImportModule

The Python package matplotlib could not be found by pyimport. Usually this means
that you did not install matplotlib in the Python version being used by PyCall.

```

---

<div class="post-metadata">

### Author: ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)
#### Post date: [September 5, 2018, 5:14am UTC](https://discourse.julialang.org/t/using-pyplot-error-initerror-pyerror-matplotlib-could-not-be-found-by-pyimport/14561/2 "2018-09-05T05:14:57Z")

</div>

Unless you have a compelling reason to use the separate Anaconda installation, the party line is to use `Conda.jl` to manage the Python installation for Julia. All you need to do is to add `ENV["PYTHON"] = ""` to your `.julia/config/startup.jl` file. The full instructions are [here](https://github.com/JuliaPy/PyCall.jl).

(From the instructions, it is not clear to me if PyCall will search for an already installed Python before installing its own.)

---

<div class="post-metadata">

### Author: ![justwawre](https://avatars.discourse-cdn.com/v4/letter/j/e19adc/32.png) [@justwawre](https://discourse.julialang.org/u/justwawre)
#### Post date: [September 5, 2018, 1:48pm UTC](https://discourse.julialang.org/t/using-pyplot-error-initerror-pyerror-matplotlib-could-not-be-found-by-pyimport/14561/3 "2018-09-05T13:48:32Z")

</div>

I don’t see any wrong.

in V1.0, on my pc, it work fine, its seting is:

v1.0) pkg\> status  
Status `~/.julia/environments/v1.0/Project.toml`  
[34da2185] Compat v1.1.0  
[a93c6f00] DataFrames v0.13.1  
[31c24e10] Distributions v0.16.2  
[7073ff75] IJulia v1.10.0  
[b964fa9f] LaTeXStrings v1.0.2  
[91a5bcdd] Plots v0.20.1  
[438e738f] PyCall v1.18.3  
[d330b81b] PyPlot v2.6.2  
[f2b01f46] Roots v0.7.2  
[37e2e46d] LinearAlgebra  
[9a3f8284] Random

shell\>

julia\> using PyPlot

julia\>
