Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Installing PyPlot in a robust way

Martin Otter edited this page Sep 19, 2018 · 1 revision

Installing PyPlot with Pkg.add("PyPlot") often fails. In this case it is recommended to install PyPlot in the following way:

  1. 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.

  2. 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")

  3. 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).

  4. If you have used a different Python installation before, execute the command Pkg.build["PyCall"], exit Julia and start Julia again.

  5. Install PyPlot via Pkg.add("PyPlot")

Clone this wiki locally