Julia v1.0 Install notes

Hey all,

I love all the work on Julia 1.0 and am looking forwarding to the language stabilizing.

I’m about to teach a class where we are (tentatively) going to use Julia 1.0 exclusively. This means we need to have plotting working :slight_smile:

I like using PyPlot for plotting, so that’s my standard.

On my own dev (linux) box, I had a lot of issues getting plots working via Atom (just to recap, it seems like trying to do things from Atom and Uber juno in terms of installing Python packages has some weird interaction I don’t understand – or this was recently fixed in a new version of PyCall, not exactly sure). Today, I got it working :slight_smile:

I wanted to see how many issues I’d have trying fresh new computer to prep for what I’d likely face trying to get 40-odd students to get it working for them.

Here are my notes as I worked through things from download of the 1.0 until everything was working

Notes on using Julia 1.0 on an Ubuntu install 17.10

Unzipped and ran julia-1.0.0/bin/julia

]update

(No updates, that was nice!)

Added Plots via ]add Plots
Got an error because curl wasn’t installed for GR and Plots
(Also, I started collecting more info at this point…)

Then

julia> using Plots; plot(Plots.fakedata(100,5))

Got

[ Info: Precompiling GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71]
/home/meng/.julia/packages/GR/fnyt8/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
[[[and a bunch more errors]]]

Eek, that seems complicated to fix. And I like PyPlot better, let’s focus our energy there.

Then I tried

julia> pyplot() 

That failed because PyPlot wasn’t installed

Next


]add PyPlot

(v1.0) pkg> add PyPlot
 Resolving package versions...
 Installed LaTeXStrings ─── v1.0.2
 Installed Conda ────────── v1.0.1
 Installed VersionParsing ─ v1.1.2
 Installed PyPlot ───────── v2.6.0
 Installed MacroTools ───── v0.4.4
 Installed PyCall ───────── v1.18.0
  Updating `~/.julia/environments/v1.0/Project.toml`
  [d330b81b] + PyPlot v2.6.0
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [8f4d0f93] + Conda v1.0.1
  [b964fa9f] + LaTeXStrings v1.0.2
  [1914dd2f] + MacroTools v0.4.4
  [438e738f] + PyCall v1.18.0
  [d330b81b] + PyPlot v2.6.0
  [81def892] + VersionParsing v1.1.2
  Building Conda ─→ `~/.julia/packages/Conda/m7vem/deps/build.log`
  Building PyCall → `~/.julia/packages/PyCall/WcrLS/deps/build.log`
┌ Error: Error building `PyCall`: 
│ ERROR: LoadError: Couldn't find libpython; check your PYTHON environment variable.
│ 
│ The python executable we tried was python3 (= version 3.6);
│ the library names we tried were ["libpython3.6m.so", "libpython3.6m", "libpython3.6", "libpython"]
│ and the library paths we tried were AbstractString["/usr/lib", "/usr/lib", "/usr", "/usr/lib"]
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] find_libpython(::String) at /home/meng/.julia/packages/PyCall/WcrLS/deps/build.jl:129
│  [3] top-level scope at logging.jl:313
│  [4] top-level scope at /home/meng/.julia/packages/PyCall/WcrLS/deps/build.jl:196
│  [5] include at ./boot.jl:317 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1038
│  [7] include(::Module, ::String) at ./sysimg.jl:29
│  [8] include(::String) at ./client.jl:388
│  [9] top-level scope at none:0
│ in expression starting at /home/meng/.julia/packages/PyCall/WcrLS/deps/build.jl:170
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068

I tried showing the environment, but didn’t see anything that looked relevant to why it didn’t pick up the “install Python within Julia via Conda” python. I have this recorded in case someone wants to see what it was. I was expecting this to do the whole Conda install

Next set

 
julia> ENV["PYTHON"] = ""

(v1.0) pkg> build PyCall
  Building Conda ─→ `~/.julia/packages/Conda/m7vem/deps/build.log`
  Building PyCall → `~/.julia/packages/PyCall/WcrLS/deps/build.log`

(v1.0) pkg> add PyPlot
 Resolving package versions...
  Updating `~/.julia/environments/v1.0/Project.toml`
 [no changes]
  Updating `~/.julia/environments/v1.0/Manifest.toml`
 [no changes]

(v1.0) pkg> build PyPlot
  Building Conda ─→ `~/.julia/packages/Conda/m7vem/deps/build.log`
  Building PyCall → `~/.julia/packages/PyCall/WcrLS/deps/build.log`

julia> pyplot()
[ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]
WARNING: could not import Base.mimewritable into PyPlot
[ Info: Installing matplotlib via the Conda matplotlib package...
[ Info: Running `conda install -y matplotlib` in root environment
Solving environment: done

## Package Plan ##

  environment location: /home/meng/.julia/packages/Conda/m7vem/deps/usr

  added / updated specs: 
    - matplotlib


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pytz-2018.5                |           py36_0         232 KB
    pcre-8.42                  |       h439df22_0         251 KB
    pyqt-5.9.2                 |   py36h22d08a2_0         5.9 MB
    sip-4.19.8                 |   py36hf484d3e_0         290 KB
    gst-plugins-base-1.14.0    |       hbbd80ab_1         6.3 MB
    python-dateutil-2.7.3      |           py36_0         260 KB
    gstreamer-1.14.0           |       hb453b48_1         3.8 MB
    expat-2.2.5                |       he0dffb1_0         186 KB
    fontconfig-2.13.0          |       h9420a91_0         291 KB
    qt-5.9.6                   |       h52aff34_0        86.7 MB
    libxcb-1.13                |       h1bed415_1         502 KB
    tornado-5.1                |   py36h14c3975_0         666 KB
    jpeg-9b                    |       h024ee3a_2         248 KB
    libuuid-1.0.3              |       h1bed415_2          16 KB
    pyparsing-2.2.0            |           py36_1          96 KB
    kiwisolver-1.0.1           |   py36hf484d3e_0          83 KB
    cycler-0.10.0              |           py36_0          13 KB
    icu-58.2                   |       h9c2bf20_1        22.5 MB
    libpng-1.6.34              |       hb9fc6fc_0         334 KB
    matplotlib-2.2.3           |   py36hb69df0a_0         6.6 MB
    dbus-1.13.2                |       h714fa37_1         554 KB
    libxml2-2.9.8              |       h26e45fe_1         2.0 MB
    freetype-2.9.1             |       h8a8886c_0         821 KB
    glib-2.56.1                |       h000015b_0         5.0 MB
    ------------------------------------------------------------
                                           Total:       143.5 MB

The following NEW packages will be INSTALLED:

    cycler:           0.10.0-py36_0        
    dbus:             1.13.2-h714fa37_1    
    expat:            2.2.5-he0dffb1_0     
    fontconfig:       2.13.0-h9420a91_0    
    freetype:         2.9.1-h8a8886c_0     
    glib:             2.56.1-h000015b_0    
    gst-plugins-base: 1.14.0-hbbd80ab_1    
    gstreamer:        1.14.0-hb453b48_1    
    icu:              58.2-h9c2bf20_1      
    jpeg:             9b-h024ee3a_2        
    kiwisolver:       1.0.1-py36hf484d3e_0 
    libpng:           1.6.34-hb9fc6fc_0    
    libuuid:          1.0.3-h1bed415_2     
    libxcb:           1.13-h1bed415_1      
    libxml2:          2.9.8-h26e45fe_1     
    matplotlib:       2.2.3-py36hb69df0a_0 
    pcre:             8.42-h439df22_0      
    pyparsing:        2.2.0-py36_1         
    pyqt:             5.9.2-py36h22d08a2_0 
    python-dateutil:  2.7.3-py36_0         
    pytz:             2018.5-py36_0        
    qt:               5.9.6-h52aff34_0     
    sip:              4.19.8-py36hf484d3e_0
    tornado:          5.1-py36h14c3975_0   


Downloading and Extracting Packages
pytz-2018.5          | 232 KB    | ###################################################################### | 100% 
pcre-8.42            | 251 KB    | ###################################################################### | 100% 
pyqt-5.9.2           | 5.9 MB    | ###################################################################### | 100% 
sip-4.19.8           | 290 KB    | ###################################################################### | 100% 
gst-plugins-base-1.1 | 6.3 MB    | ###################################################################### | 100% 
python-dateutil-2.7. | 260 KB    | ###################################################################### | 100% 
gstreamer-1.14.0     | 3.8 MB    | ###################################################################### | 100% 
expat-2.2.5          | 186 KB    | ###################################################################### | 100% 
fontconfig-2.13.0    | 291 KB    | ###################################################################### | 100% 
qt-5.9.6             | 86.7 MB   | ###################################################################### | 100% 
libxcb-1.13          | 502 KB    | ###################################################################### | 100% 
tornado-5.1          | 666 KB    | ###################################################################### | 100% 
jpeg-9b              | 248 KB    | ###################################################################### | 100% 
libuuid-1.0.3        | 16 KB     | ###################################################################### | 100% 
pyparsing-2.2.0      | 96 KB     | ###################################################################### | 100% 
kiwisolver-1.0.1     | 83 KB     | ###################################################################### | 100% 
cycler-0.10.0        | 13 KB     | ###################################################################### | 100% 
icu-58.2             | 22.5 MB   | ###################################################################### | 100% 
libpng-1.6.34        | 334 KB    | ###################################################################### | 100% 
matplotlib-2.2.3     | 6.6 MB    | ###################################################################### | 100% 
dbus-1.13.2          | 554 KB    | ###################################################################### | 100% 
libxml2-2.9.8        | 2.0 MB    | ###################################################################### | 100% 
freetype-2.9.1       | 821 KB    | ###################################################################### | 100% 
glib-2.56.1          | 5.0 MB    | ###################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
ERROR: ArgumentError: Package PyCall not found in current path:
- Run `Pkg.add("PyCall")` to install the PyCall package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:817
 [2] top-level scope at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:389
 [3] eval at ./boot.jl:319 [inlined]
 [4] _initialize_backend(::Plots.PyPlotBackend) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:388
 [5] backend(::Plots.PyPlotBackend) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:196
 [6] backend(::Symbol) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:209
 [7] pyplot() at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:29
 [8] top-level scope at none:0

At this point, I restarted Julia

Now things get weird. (Didn’t we just install these?)


              _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Plots; pyplot(); plot(Plots.fakedata(100,5))
ERROR: ArgumentError: Package PyCall not found in current path:
- Run `Pkg.add("PyCall")` to install the PyCall package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:817
 [2] top-level scope at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:389
 [3] eval at ./boot.jl:319 [inlined]
 [4] _initialize_backend(::Plots.PyPlotBackend) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:388
 [5] backend(::Plots.PyPlotBackend) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:196
 [6] backend(::Symbol) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:209
 [7] pyplot() at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:29
 [8] top-level scope at none:0

(v1.0) pkg> add PyCall
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `~/.julia/environments/v1.0/Project.toml`
  [438e738f] + PyCall v1.18.0
  Updating `~/.julia/environments/v1.0/Manifest.toml`
 [no changes]

julia> using Plots; pyplot(); plot(Plots.fakedata(100,5))
ERROR: ArgumentError: Package LaTeXStrings not found in current path:
- Run `Pkg.add("LaTeXStrings")` to install the LaTeXStrings package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:817
 [2] top-level scope at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:390
 [3] eval at ./boot.jl:319 [inlined]
 [4] _initialize_backend(::Plots.PyPlotBackend) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:388
 [5] backend(::Plots.PyPlotBackend) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:196
 [6] backend(::Symbol) at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:209
 [7] pyplot() at /home/meng/.julia/packages/Plots/LWBTU/src/backends.jl:29
 [8] top-level scope at none:0

(v1.0) pkg> add PyPlot
 Resolving package versions...
  Updating `~/.julia/environments/v1.0/Project.toml`
 [no changes]
  Updating `~/.julia/environments/v1.0/Manifest.toml`
 [no changes]

(v1.0) pkg> add LaTeXStrings
 Resolving package versions...
  Updating `~/.julia/environments/v1.0/Project.toml`
  [b964fa9f] + LaTeXStrings v1.0.2
  Updating `~/.julia/environments/v1.0/Manifest.toml`
 [no changes]


julia> using Plots; pyplot(); plot(Plots.fakedata(100,5))

And then it worked!!

Next, install Atom.
This failed due to a few things with gconf2, ugh. Whatever.
uber-juno found the wrong Julia, but that’s expected, because I didn’t realize an old Julia was installed on this machine :slight_smile:

It did install the new packages Juno.jl, that was good!

Note that the Julia logo looks wrong in the Juno editor. The white underscores are missing. Didn’t record a screenshot, but I assume people have seen this.


julia> using Plots; pyplot(); plot(Plots.fakedata(100,5))

This showed a picture in the plotpane, great!

If you turn off the plotpane, then


julia> using Plots; pyplot(); plot(Plots.fakedata(100,5))

shows a plot if you execute it from the REPL-console.

However, if you try and Ctrl-Enter or Alt-Enter to run it from the editor, (after selecting Julia as the file type), then it doesn’t show.

If you want to get the plot to show, you need to add gui()


 julia> using Plots; pyplot(); plot(Plots.fakedata(100,5)); gui()

There are known bugs with GR without the plotpane, so I’m not going to get into those. (see another thread in julia-users).

All in all, some room for improvement, but I got it working with a minimal amount of fuss! I hope these notes are helpful to others. I hope these notes are outdated rapidly! I’m going to try Windows and MacOSX over the next few days, so I’ll post any relevant notes here to.

1 Like

My journey was much easier than yours, I got Error Precompiling PyPlot in latest Julia 1.0.0-rc1.1 and two days later, ] up solved the issue. I use Windows 10.

Great to hear that things seem to work there! I don’t regularly use Windows anymore, so it’s hard for me to keep up to date there. Last time I did this (0.5 or 0.6 – I can’t remember now), Windows (easiest) was easier to install than Linux was easier than Mac. Although, if I recall, most of the Mac issues had to do with bad Python versions and Matplotlib, which I think has been fixed using the Conda stuff.

Will you need plotting at the beginning of classes? If you are only introducing it at the middle of the semester or later, then there are better chances of having it working :smile:
I’ll be teaching basic programming for Engineers with Julia. I’ll try reling on packages that are not part of stdlib only after a few weeks. Hopefully everything will catch up until then.

Why do you require the Atom integration for the class? Just let people use a terminal and their editor of choice.

2 Likes

The requirements for GR on Ubuntu (see Julia Package GR — GR Framework 0.66.0 documentation) are:

apt install libxt6 libxrender1 libgl1-mesa-glx libqt5widgets5

Once those are installed, you can ]add GR

1 Like

There is no requirement that people use Atom. It is merely, and in the past, one of the few recommended ways to use Julia that we will offer the most assistance with. Myself, and many of the other students, do not like using terminal environments.

I’m very confused about what was happening here. How did you manage to get it to insatll PyPlot without installing PyCall? The package manager should not allow it to do that.

Do you have some elaborate conda setup here? If it can’t find libpython, on Ubuntu you should just do apt search libpython, find your python version, do sudo apt install libpython3.6-dev (or whatever) and then you will have the *.so’s in all the right places.

My experience (Manjaro Linux) was:

  • Download binaries.
  • Put binaries in /opt/julia/bin
  • Do ]add PackageName for packages I want (granted, many things are still not working on 1.0, so of course those won’t work. In some cases dev PackageName does the trick.)
  • Done

To be fair, I didn’t really use any python dependencies, but I’m pretty confident my system python is setup correctly.

At the risk of sounding like a stodgy old man, back when I first started programming (circa 2007) basically the intro I got was “Ok the fortran compiler is called gfortran, edit files with emacs -nw. Here are some unbelievably arcane source code examples. Knock yourself out.” I feel like I would have learned a lot less if someone came a long with some slick IDE and put me in some educational sandbox.

1 Like

I had the same experience with installing PyPlot as mentioned here. Had to install several packages manually, etc. On Julia 0.6.4 everything worked automatically, if you tried to install PyPlot, if I remember correctly. You might had to build PyCall.

Here is my log on OSX.

Note that I got the same thing where PyPlot was installed but PyCall seemed to not to understand that it was installed on OSX too. There may be something to look into here.

Hm, I had a theory that PyPlot had a build process that was running before the package manager had a chance to check for PyCall, but this turns out not to be the case. (I know the Pkg devs are working on having independent build dependencies.)

It seems the problem originates here. Since neither Requires nor Plots has PyCall (or even PyPlots) in their REQUIRE file, it’s possible to run Plots and call using PyCall without the package manager ever knowing anything about it.

In the short term it should be trivial to solve this just by always installing PyPlots first. It’s probably reasonable for the Plots devs to ask users to always install the back-ends they wish to use first.

In the long run, I’m not sure if there were any plans to add conditional dependencies to the package manager. It’s not even entirely clear what the package manager should do here. If I were a Plots maintainer I would probably opt to simply catch the error and return a more informative error message. On the other hand, I thought Requires should already do that.

It might be worth filing an issue in Plots, Requires or both.

The problem is, to be specific, that the Plots “pyplot” backend is not just a front-end to the PyPlot package - it mostly bypasses PyPlot and calls direcly into matplotlib via PyCall (and LaTeXStrings), which usually was not a problem, because those were loaded as dependencies of PyPlot.

On 1.0, though, (Pkg3 to be exact) you can’t import a package that was installed as a dependency - you can only import packages you’ve explicitly installed. That changes the installation procedure - we’ve updated the error message on the newest release of Plots (https://github.com/JuliaPlots/Plots.jl/pull/1656/files) but it may not be shown appropriately.

So it’s not Requires-related.

4 Likes

This may be unique to my own wonky system (Windows 10), but PyPlot also seems to forget that I am using Anaconda with every update and proceeds to download miniConda. I have to set ENV[“PYTHON”] everytime I update packages. Never was an issue on v0.6.4, but I could also have broken something. Then again, maybe PyPlot is still deciding whether it likes the new Julia…

Were you setting ENV["PYTHON"] in your .juliarc.jl startup file? The location of the startup file changed from 0.6.4 to 0.7: it’s now ~/.julia/config/startup.jl so you need to put the ENV["PYTHON"] setting in the new file for it to take effect in v0.7 and above.

1 Like

Tried that. Also for ENV[“JUPYTER”], but an error flashed over the screen with every start-up. Too fast to read the whole thing. I think it is time to reinstall Julia and try again. Killing the process in the middle of miniConda downloads/build probably rattled it once too often. This is Windows, after all…

Thanks for the advice, though! Will let you know what the clean start brings.

Oof, that really shouldn’t be necessary. If you want to actually read the error, you can open up your windows terminal, cd to wherever Julia lives, and just run the Julia exe from that terminal. That should keep the error message visible even if Julia crashes.

1 Like

Ok. Appologies to PyCall. “User error. Please replace user. Press any key to continue…”. Turns out if you misspell the executable name, you get a very brief LOAD ERROR message. Fixed my typo. Works perfectly! Man, I love the new package manager.

1 Like

Packages are fundamentally stored differently in 0.6 and 0.7. In 0.7 a copy of each version of a package is stored so if the package stores large files in its own directory that will have to happen for each version.

And thanks agan @rdeits!

What’s the recommended way of sharing a large data file across package versions?