“使用PyPlot”导致Windows 10上的Julia 1.0.0错误:“ pyimport无法找到Python软件包matplotlib。 ”

Julia 1.0.0 on Windows 10 error from 'using PyPlot': “The Python package matplotlib could not be found by pyimport. ”

刚刚从julialang.org安装了Julia 1.0.0
做了以下事情:

1
using Pkg

Pkg.add(" PyPlot")
使用PyPlot

。 。 。 得到这个错误:
pyimport找不到Python软件包matplotlib。 通常,这意味着您没有在PyCall使用的Python版本中安装matplotlib。

我已经安装了Python。

JULIA 1.0.0日志已满...………

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
               _
   _       _ _(_)_     |  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
egistries\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.


这是否有帮助(将正确的路径设置为anaconda python二进制文件)?

1
2
3
4
ENV["PYTHON"] ="c:\\full\\path\\to\\anaconda\\bin\\python"
using Pkg
Pkg.build("PyCall")
using PyPlot