PyCall installation failure in Julia's official docker image

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
INFO: Cloning cache of ColorTypes from https://github.com/JuliaGraphics/ColorTypes.jl.git
INFO: Cloning cache of Colors from https://github.com/JuliaGraphics/Colors.jl.git
INFO: Cloning cache of Compat from https://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of Conda from https://github.com/JuliaPy/Conda.jl.git
INFO: Cloning cache of FixedPointNumbers from https://github.com/JuliaMath/FixedPointNumbers.jl.git
INFO: Cloning cache of JSON from https://github.com/JuliaIO/JSON.jl.git
INFO: Cloning cache of LaTeXStrings from https://github.com/stevengj/LaTeXStrings.jl.git
INFO: Cloning cache of MacroTools from https://github.com/MikeInnes/MacroTools.jl.git
INFO: Cloning cache of Nullables from https://github.com/JuliaArchive/Nullables.jl.git
INFO: Cloning cache of PyCall from https://github.com/JuliaPy/PyCall.jl.git
INFO: Cloning cache of PyPlot from https://github.com/JuliaPy/PyPlot.jl.git
INFO: Cloning cache of Reexport from https://github.com/simonster/Reexport.jl.git
INFO: Cloning cache of VersionParsing from 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!

1 Like

Update:

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

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

Here you go:
https://github.com/jupyter/docker-stacks

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

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

https://github.com/Seanny123/dockerfiles/blob/master/pyjulia/Dockerfile

2 Likes