# Struggling with Julia configuration

**URL:** <https://discourse.julialang.org/t/struggling-with-julia-configuration/7656>\
**Category:** New to Julia\
**Created:** [December 9, 2017, 5:56pm UTC](https://discourse.julialang.org/t/struggling-with-julia-configuration/7656 "2017-12-09T17:56:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartosz](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bartosz](https://discourse.julialang.org/u/bartosz)\
**Post date:** [December 9, 2017, 5:56pm UTC](https://discourse.julialang.org/t/struggling-with-julia-configuration/7656/1 "2017-12-09T17:56:41Z")

</div>

Hello,  
recently I’ve installed Julia and python on my PC (Ubuntu 16.04 LTS) and tried to give it a try. Everything works good until I want to use plotting. Here is a piece of code I’d like to compile:

```julia
Pkg.add("PyPlot")
using Plots
pyplot()
plot(rand(10))

```

I used juliabox to check if it works and it does w/o any issues. My output for command julia exp.jl looks like this:

```julia
sys:1: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to u'Qt5Agg' by the following code:
  File "/home/bartosz/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/backends/ __init__.py", line 14, in <module>
    line for line in traceback.format_stack()

INFO: Nothing to be done
WARNING: No working GUI backend found for matplotlib
WARNING: Couldn't initialize pyplot. (might need to install it?)
ERROR: LoadError: InitError: PyError (:PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError("/lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/bartosz/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/../../.././libpng16.so.16)",)
  File "/home/bartosz/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/pyplot.py", line 29, in <module>
    import matplotlib.colorbar
  File "/home/bartosz/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/colorbar.py", line 36, in <module>
    import matplotlib.contour as contour
  File "/home/bartosz/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/contour.py", line 21, in <module>
    import matplotlib.font_manager as font_manager
  File "/home/bartosz/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/font_manager.py", line 58, in <module>
    from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir

 [inlined code] from /home/bartosz/.julia/v0.4/PyCall/src/exception.jl:81
 in pyimport at /home/bartosz/.julia/v0.4/PyCall/src/PyCall.jl:392
during initialization of module PyPlot
while loading /home/bartosz/exp.jl, in expression starting on line 4

```

I tried to do:

- ENV[“PYTHON”]=“”
- Pkg.build(“PyCall”)

Need help cause I’m kinda new. Any help would be appreciated 🙂

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [December 9, 2017, 6:46pm UTC](https://discourse.julialang.org/t/struggling-with-julia-configuration/7656/2 "2017-12-09T18:46:05Z")

</div>

Does your python/matplotlib istallation work (i.e. what the ubuntu package manager installs, not Julia pkgs)? Try running one of the simple examples on matplotlib’s website.

---

<div class="post-metadata">

**Author:** ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Post date:** [December 9, 2017, 7:02pm UTC](https://discourse.julialang.org/t/struggling-with-julia-configuration/7656/3 "2017-12-09T19:02:29Z")

</div>

You can try the work-arounds in [the libz issue for PyPlot](https://github.com/JuliaPy/PyPlot.jl/issues/151). I also recommend using the binary Julia distributions from [the official website](https://julialang.org/downloads/) rather than the Ubuntu package: Julia v0.4 is no longer supported by the people who matter, and packages like PyPlot have numerous bug fixes not available for v0.4.

---

<div class="post-metadata">

**Author:** ![bartosz](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bartosz](https://discourse.julialang.org/u/bartosz)\
**Post date:** [December 10, 2017, 2:59pm UTC](https://discourse.julialang.org/t/struggling-with-julia-configuration/7656/4 "2017-12-10T14:59:06Z")

</div>

[https://matplotlib.org/examples/pylab\_examples/simple\_plot.html](https://matplotlib.org/examples/pylab_examples/simple_plot.html) I’ve run this example and it works like magic. Julia still doesn’t ;c

---

<div class="post-metadata">

**Author:** ![Nitin\_Arora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitin_arora/32/1174_2.png) [@Nitin\_Arora](https://discourse.julialang.org/u/Nitin_Arora)\
**Post date:** [December 10, 2017, 5:34pm UTC](https://discourse.julialang.org/t/struggling-with-julia-configuration/7656/5 "2017-12-10T17:34:58Z")

</div>

Like Ralph\_Smith suggested above, please update your julia version to 0.6 or use the latest stable binary and try again please. I just ran your example on a fresh v0.6 install on Ubuntu 16.04 and it worked just fine.
