- 1 year ago
Julia 1.0.0 on Windows 10 using PyPlot compiler error because it can't load library expected at: .julia\\packages\\Conda\\m7vem\\deps\\usr\\python37\
The error you are encountering with Julia 1.0.0 and PyPlot on Windows 10 seems to be related to the Python package manager Conda
not being able to load the required library. This can happen when there is an issue with the Conda environment or the path to the Python executable.
To resolve this issue, you can try the following steps:
Check Python Installation: Make sure you have Python 3.7 installed on your system, and its executable is added to the system PATH. You can verify this by running
python --version
in the Command Prompt or PowerShell to check if Python 3.7 is installed and correctly accessible.Update Conda: If you have Conda installed, update it to the latest version using the following command in the Command Prompt or PowerShell:
sqlconda update --all
Create a New Conda Environment: Create a new Conda environment specifically for Julia using Python 3.7. You can do this by running the following commands:
luaconda create -n julia python=3.7
conda activate julia
Install PyPlot: With the new Conda environment activated, install PyPlot using the following command:
rconda install -c conda-forge matplotlib
Start Julia: Now, start Julia, and before using the PyPlot package, set the PyCall Python environment variable to point to the new Conda environment. For example, if the Conda environment is located at
C:\Users\YourUsername\.conda\envs\julia
, use the following command in Julia:juliaENV["PYTHON"] = "C:\\Users\\YourUsername\\.conda\\envs\\julia\\python.exe"
Install PyPlot in Julia: Finally, install the PyPlot package in Julia:
juliausing Pkg
Pkg.add("PyPlot")
After following these steps, you should be able to use PyPlot with Julia 1.0.0 on Windows 10 without encountering the library loading error.
Please note that these steps assume you have both Julia and Conda installed on your system. If you don't have Conda, you can install it from the Anaconda distribution (https://www.anaconda.com/products/individual) before proceeding with the above steps.