-
Notifications
You must be signed in to change notification settings - Fork 36
Installing PyPlot in a robust way
Installing PyPlot with Pkg.add("PyPlot")
often fails. In this case it is recommended to install PyPlot
in the following way:
-
Install a Python 3.x distribution that contains Matplotlib.
Recommended: Anaconda distribution.
Advantage: very robust;
Disadvantage: > 3 GByte memory needed;
ModiaMath is based on the Python 3.x version of Matplotlib where some keywords are different to the Python 2.x version. -
Include the path to the Python executable in your startup file (Julia 1.0:
<path-to-user>/.julia/config/startup.jl):
ENV["PYTHON"] = joinpath("<path-above-Anaconda3>", "Anaconda3", "python.exe") -
Start Julia, give the command
ENV["PYTHON"]in the REPL, and check whether the path is correct (if you made a typo in the startup file, Julia might use another Python executable and PyPlot might crash Julia). -
If you have used a different Python installation before, execute the command
Pkg.build["PyCall"], exit Julia and start Julia again. -
Install PyPlot via
Pkg.add("PyPlot")