# PyCall installation failure in Julia's official docker image

**URL:** <https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693>\
**Category:** General Usage\
**Created:** [August 18, 2018, 11:59pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693 "2018-08-18T23:59:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norman](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@Norman](https://discourse.julialang.org/u/Norman)\
**Post date:** [August 18, 2018, 11:59pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693/1 "2018-08-18T23:59:13Z")

</div>

I am new to docker and I want to use Julia’s official docker image to run GitLab CI. I need to install PyPlot.jl into the Julia docker image. But, since PyCall.jl is not installed properly, the job is failed. Below are the details:

In the .gitlab-ci.yml, I have the following lines to install PyPlot.jl:

```
job:
  image: julia:0.6.4
  before_script:
    - julia -e "Pkg.add(\"PyPlot\")"

```

The pipepline job fails because PyCall.jl is not installed properly.  
Here is the command line output on GitLab CI job:

```
$ julia -e "Pkg.add(\"PyPlot\")"

```

INFO: Initializing package repository /root/.julia/v0.6  
INFO: Cloning METADATA from [https://github.com/JuliaLang/METADATA.jl](https://github.com/JuliaLang/METADATA.jl)  
INFO: Cloning cache of ColorTypes from [https://github.com/JuliaGraphics/ColorTypes.jl.git](https://github.com/JuliaGraphics/ColorTypes.jl.git)  
INFO: Cloning cache of Colors from [https://github.com/JuliaGraphics/Colors.jl.git](https://github.com/JuliaGraphics/Colors.jl.git)  
INFO: Cloning cache of Compat from [https://github.com/JuliaLang/Compat.jl.git](https://github.com/JuliaLang/Compat.jl.git)  
INFO: Cloning cache of Conda from [https://github.com/JuliaPy/Conda.jl.git](https://github.com/JuliaPy/Conda.jl.git)  
INFO: Cloning cache of FixedPointNumbers from [https://github.com/JuliaMath/FixedPointNumbers.jl.git](https://github.com/JuliaMath/FixedPointNumbers.jl.git)  
INFO: Cloning cache of JSON from [https://github.com/JuliaIO/JSON.jl.git](https://github.com/JuliaIO/JSON.jl.git)  
INFO: Cloning cache of LaTeXStrings from [https://github.com/stevengj/LaTeXStrings.jl.git](https://github.com/stevengj/LaTeXStrings.jl.git)  
INFO: Cloning cache of MacroTools from [https://github.com/MikeInnes/MacroTools.jl.git](https://github.com/MikeInnes/MacroTools.jl.git)  
INFO: Cloning cache of Nullables from [https://github.com/JuliaArchive/Nullables.jl.git](https://github.com/JuliaArchive/Nullables.jl.git)  
INFO: Cloning cache of PyCall from [https://github.com/JuliaPy/PyCall.jl.git](https://github.com/JuliaPy/PyCall.jl.git)  
INFO: Cloning cache of PyPlot from [https://github.com/JuliaPy/PyPlot.jl.git](https://github.com/JuliaPy/PyPlot.jl.git)  
INFO: Cloning cache of Reexport from [https://github.com/simonster/Reexport.jl.git](https://github.com/simonster/Reexport.jl.git)  
INFO: Cloning cache of VersionParsing from [https://github.com/stevengj/VersionParsing.jl.git](https://github.com/stevengj/VersionParsing.jl.git)  
INFO: Installing ColorTypes v0.6.7  
INFO: Installing Colors v0.8.2  
INFO: Installing Compat v1.0.1  
INFO: Installing Conda v1.0.1  
INFO: Installing FixedPointNumbers v0.4.6  
INFO: Installing JSON v0.17.2  
INFO: Installing LaTeXStrings v1.0.2  
INFO: Installing MacroTools v0.4.4  
INFO: Installing Nullables v0.0.7  
INFO: Installing PyCall v1.18.0  
INFO: Installing PyPlot v2.6.0  
INFO: Installing Reexport v0.1.0  
INFO: Installing VersionParsing v1.1.2  
INFO: Building Conda  
INFO: Building PyCall  
Info: Using the Python distribution in the Conda package by default.  
To use a different Python version, set ENV[“PYTHON”]=“pythoncommand” and re-run Pkg.build(“PyCall”).  
Info: Downloading miniconda installer …  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0  
100 55.7M 100 55.7M 0 0 89.1M 0 --:–:-- --:–:-- --:–:-- 89.2M  
Info: Installing miniconda …  
WARNING: bzip2 does not appear to be installed this may cause problems below  
PREFIX=/root/.julia/v0.6/Conda/deps/usr  
/root/.julia/v0.6/Conda/deps/usr/installer.sh: 343: /root/.julia/v0.6/Conda/deps/usr/installer.sh: bunzip2: not found  
tar: This does not look like a tar archive  
tar: Exiting with failure status due to previous errors  
===============================[ERROR: PyCall]================================

LoadError: failed process: Process(`/root/.julia/v0.6/Conda/deps/usr/installer.sh -b -f -p /root/.julia/v0.6/Conda/deps/usr`, ProcessExited(1)) [1]  
while loading /root/.julia/v0.6/PyCall/deps/build.jl, in expression starting on line 265

================================================================================

================================[BUILD ERRORS]================================

WARNING: PyCall had build errors.

- packages with build errors remain installed in /root/.julia/v0.6
- build the package(s) and all dependencies with `Pkg.build("PyCall")`
- build a single package by running its `deps/build.jl` script

================================================================================  
INFO: Package database updated

When the actual Julia code is run, I got

```
ERROR: LoadError: LoadError: PyCall not properly installed. Please run Pkg.build("PyCall")

```

Can someone show me the correct way to install PyPlot.jl/PyCall.jl? Thanks!

---

<div class="post-metadata">

**Author:** ![Norman](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@Norman](https://discourse.julialang.org/u/Norman)\
**Post date:** [August 19, 2018, 8:57pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693/2 "2018-08-19T20:57:33Z")

</div>

Update:

I end up using a different docker image and the problem has been solved.

---

<div class="post-metadata">

**Author:** ![Seanny123](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/seanny123/32/5271_2.png) [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Post date:** [December 4, 2018, 10:34pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693/3 "2018-12-04T22:34:40Z")

</div>

What docker image did you end up using? Would you mind sharing the Docker image you used wherein `PyCall.jl` did work?

---

<div class="post-metadata">

**Author:** ![Norman](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@Norman](https://discourse.julialang.org/u/Norman)\
**Post date:** [December 4, 2018, 10:46pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693/4 "2018-12-04T22:46:35Z")

</div>

Here you go:  
[https://github.com/jupyter/docker-stacks](https://github.com/jupyter/docker-stacks)

You can pick one that satisfies your need based on their user guide.

---

<div class="post-metadata">

**Author:** ![Seanny123](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/seanny123/32/5271_2.png) [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Post date:** [December 6, 2018, 3:00pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693/5 "2018-12-06T15:00:22Z")

</div>

I ended up making my own Dockerfile for a PyJulia installation:

[https://github.com/Seanny123/dockerfiles/blob/master/pyjulia/Dockerfile](https://github.com/Seanny123/dockerfiles/blob/master/pyjulia/Dockerfile)
