title: Julia: Failure to Configure PyCall to use a Different Version
body: <p>I'm wanting to use a range of Python libraries in my Julia code. I've been trying to use PyCall to access the Python libraries I have installed on my (windows) PC already; however, I have been unable to reconfigure PyCall away from its default Python distribution which is private to Julia. Following the steps in the documentation (<a href="https://github.com/JuliaPy/PyCall.jl" rel="nofollow noreferrer">https://github.com/JuliaPy/PyCall.jl</a>),  I attempted the following in Julia:</p>
  <pre><code>using Pkg
  
  ENV[&quot;PYTHON&quot;] = raw&quot;C:\Users\catod\AppData\Local\Programs\Python\Python37-32\python.exe&quot;
  
  Pkg.build(PyCall)
  </code></pre>
  <p>After exiting and reentering Julia, I attempted to run</p>
  <pre><code>using PyCall
  
  plt = pyimport(&quot;matplotlib.pyplot&quot;)
  </code></pre>
  <p>but got the following error message:</p>
  <pre><code>ERROR: LoadError: PyError (PyImport_ImportModule
  
  The Python package matplotlib.pyplot could not be imported by pyimport. Usually this means
  that you did not install matplotlib.pyplot in the Python version being used by PyCall.    
  
  PyCall is currently configured to use the Julia-specific Python distribution
  installed by the Conda.jl package.  To install the matplotlib.pyplot module, you can      
  use `pyimport_conda(&quot;matplotlib.pyplot&quot;, PKG)`, where PKG is the Anaconda
  package the contains the module matplotlib.pyplot, or alternatively you can use the
  Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
  
  Alternatively, if you want to use a different Python distribution on your
  system, such as a system-wide Python (as opposed to the Julia-specific Python),
  you can re-configure PyCall with that Python.   As explained in the PyCall
  documentation, set ENV[&quot;PYTHON&quot;] to the path/name of the python executable
  you want to use, run Pkg.build(&quot;PyCall&quot;), and re-launch Julia.
  
  ) &lt;class 'ModuleNotFoundError'&gt;
  ModuleNotFoundError(&quot;No module named 'matplotlib'&quot;)
  </code></pre>
  <p>Can anyone point out where I have gone wrong?</p>