<p dir="auto">I have installed a number of modules system-wide under <code class="notranslate">/usr/share/julia/environments/v1.0</code> using a Linux distribution package <a href="https://aur.archlinux.org/packages/julia-ijulia/" rel="nofollow">https://aur.archlinux.org/packages/julia-ijulia/</a></p>
<p dir="auto">With Julia 1.0.2 these packages are detected and loaded, e.g.:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ strace -f -estat julia
...
julia&gt; using IJulia
[pid 30509] stat(&quot;/home/jonathon/.julia/environments/v1.0&quot;, 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/local/share/julia/environments/v1.0&quot;, 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0&quot;, {st_mode=S_IFDIR|0755, st_size=242, ...}) = 0
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0/JuliaProject.toml&quot;, 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0/Project.toml&quot;, 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0&quot;, {st_mode=S_IFDIR|0755, st_size=242, ...}) = 0
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0/JuliaProject.toml&quot;, 0x7ffdf6e55340) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0/Project.toml&quot;, 0x7ffdf6e55340) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0/IJulia.jl&quot;, 0x7ffdf6e55340) = -1 ENOENT (No such file or directory)
[pid 30509] stat(&quot;/usr/share/julia/environments/v1.0/IJulia/src/IJulia.jl&quot;, {st_mode=S_IFREG|0644, st_size=12461, ...}) = 0
..."><pre class="notranslate"><code class="notranslate">$ strace -f -estat julia
...
julia&gt; using IJulia
[pid 30509] stat("/home/jonathon/.julia/environments/v1.0", 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/local/share/julia/environments/v1.0", 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/share/julia/environments/v1.0", {st_mode=S_IFDIR|0755, st_size=242, ...}) = 0
[pid 30509] stat("/usr/share/julia/environments/v1.0/JuliaProject.toml", 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/share/julia/environments/v1.0/Project.toml", 0x7ffdf6e551e0) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/share/julia/environments/v1.0", {st_mode=S_IFDIR|0755, st_size=242, ...}) = 0
[pid 30509] stat("/usr/share/julia/environments/v1.0/JuliaProject.toml", 0x7ffdf6e55340) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/share/julia/environments/v1.0/Project.toml", 0x7ffdf6e55340) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/share/julia/environments/v1.0/IJulia.jl", 0x7ffdf6e55340) = -1 ENOENT (No such file or directory)
[pid 30509] stat("/usr/share/julia/environments/v1.0/IJulia/src/IJulia.jl", {st_mode=S_IFREG|0644, st_size=12461, ...}) = 0
...
</code></pre></div>
<p dir="auto">Note that it looks under the path <code class="notranslate">/usr/share/julia/environments/v1.0/IJulia/src/IJulia.jl</code>.</p>
<p dir="auto">With 1.0.3 this fails:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; using IJulia
[pid 17444] stat(&quot;/home/jonathon/.julia/environments/v1.0&quot;, 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/local/share/julia/environments/v1.0&quot;, 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/environments/v1.0&quot;, {st_mode=S_IFDIR|0755, st_size=242, ...}) = 0
[pid 17444] stat(&quot;/usr/share/julia/environments/v1.0/JuliaProject.toml&quot;, 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/environments/v1.0/Project.toml&quot;, 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/home/jonathon/.julia/environments/v1.0/Project.toml&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/home/jonathon/.julia/environments/v1.0/Project.toml&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/stdlib/v1.0&quot;, {st_mode=S_IFDIR|0755, st_size=460, ...}) = 0
[pid 17444] stat(&quot;/usr/share/julia/stdlib/v1.0/JuliaProject.toml&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/stdlib/v1.0/Project.toml&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/stdlib/v1.0/IJulia.jl&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/stdlib/v1.0/IJulia/src/IJulia.jl&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat(&quot;/usr/share/julia/stdlib/v1.0/IJulia.jl/src/IJulia.jl&quot;, 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
ERROR: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add(&quot;IJulia&quot;)` to install the IJulia package."><pre class="notranslate"><code class="notranslate">julia&gt; using IJulia
[pid 17444] stat("/home/jonathon/.julia/environments/v1.0", 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/local/share/julia/environments/v1.0", 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/environments/v1.0", {st_mode=S_IFDIR|0755, st_size=242, ...}) = 0
[pid 17444] stat("/usr/share/julia/environments/v1.0/JuliaProject.toml", 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/environments/v1.0/Project.toml", 0x7ffe0d5fde00) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/home/jonathon/.julia/environments/v1.0/Project.toml", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/home/jonathon/.julia/environments/v1.0/Project.toml", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/stdlib/v1.0", {st_mode=S_IFDIR|0755, st_size=460, ...}) = 0
[pid 17444] stat("/usr/share/julia/stdlib/v1.0/JuliaProject.toml", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/stdlib/v1.0/Project.toml", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/stdlib/v1.0/IJulia.jl", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/stdlib/v1.0/IJulia/src/IJulia.jl", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
[pid 17444] stat("/usr/share/julia/stdlib/v1.0/IJulia.jl/src/IJulia.jl", 0x7ffe0d5fdf80) = -1 ENOENT (No such file or directory)
ERROR: ArgumentError: Package IJulia not found in current path:
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
</code></pre></div>
<p dir="auto">Note that it no longer looks in subdirectories under the path <code class="notranslate">/usr/share/julia/environments/v1.0/</code>.</p>
<p dir="auto">I am currently investigating <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/JuliaLang/julia/commit/eb8a9333b040b8dc86b2ed7a93bb23e70830cf14/hovercard" href="https://github.com/JuliaLang/julia/commit/eb8a9333b040b8dc86b2ed7a93bb23e70830cf14"><tt>eb8a933</tt></a> and <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/JuliaLang/julia/commit/71748da03b5a8f9a52fee021570a803e33e309a5/hovercard" href="https://github.com/JuliaLang/julia/commit/71748da03b5a8f9a52fee021570a803e33e309a5"><tt>71748da</tt></a> as potentially related but I don't really know if they are.</p>
<hr>
<p dir="auto">Julia distro package: <a href="https://www.archlinux.org/packages/community/x86_64/julia/" rel="nofollow">https://www.archlinux.org/packages/community/x86_64/julia/</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-08 20:11 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)"><pre class="notranslate"><code class="notranslate">julia&gt; versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-08 20:11 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo()
Julia Version 1.0.3
Commit 099e826241* (2018-12-18 01:34 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)"><pre class="notranslate"><code class="notranslate">julia&gt; versioninfo()
Julia Version 1.0.3
Commit 099e826241* (2018-12-18 01:34 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)
</code></pre></div>
<hr>
<p dir="auto">Mainly for my own reference, full list of changes between 1.0.2 and 1.0.3: <a class="commit-link" href="https://github.com/JuliaLang/julia/compare/v1.0.2...v1.0.3"><tt>v1.0.2...v1.0.3</tt></a></p>
<p dir="auto">I'm using Julia Version 0.5.0 (2016-09-19 18:14 UTC) and noticed that in a comprehension you can't iterate over empty sequences unless that variable is the last one. (EDIT: I just tested in the binaries of the nightly builds and the same thing happens.)</p>
<p dir="auto">I'd expect both of these comprehensions to result in empty arrays:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; [a for a in [1] for b in []]
0-element Array{Int64,1}

julia&gt; [a for a in [] for b in [1]]
ERROR: ArgumentError: argument to Flatten must contain at least one iterator
 in start(::Base.Flatten{Base.Generator{Array{Any,1},##193#195}}) at ./iterator.jl:599
 in grow_to!(::Array{Any,1}, ::Base.Flatten{Base.Generator{Array{Any,1},##193#195}}) at ./array.jl:357
 in collect(::Base.Flatten{Base.Generator{Array{Any,1},##193#195}}) at ./array.jl:273"><pre class="notranslate">julia<span class="pl-k">&gt;</span> [a <span class="pl-k">for</span> a <span class="pl-k">in</span> [<span class="pl-c1">1</span>] <span class="pl-k">for</span> b <span class="pl-k">in</span> []]
<span class="pl-c1">0</span><span class="pl-k">-</span>element Array{Int64,<span class="pl-c1">1</span>}

julia<span class="pl-k">&gt;</span> [a <span class="pl-k">for</span> a <span class="pl-k">in</span> [] <span class="pl-k">for</span> b <span class="pl-k">in</span> [<span class="pl-c1">1</span>]]
ERROR<span class="pl-k">:</span> ArgumentError<span class="pl-k">:</span> argument to Flatten must contain at least one iterator
 <span class="pl-k">in</span> <span class="pl-c1">start</span>(<span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{Array{Any,1},##193#195}}</span>) at <span class="pl-k">./</span>iterator<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">599</span>
 <span class="pl-k">in</span> <span class="pl-c1">grow_to!</span>(<span class="pl-k">::</span><span class="pl-c1">Array{Any,1}</span>, <span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{Array{Any,1},##193#195}}</span>) at <span class="pl-k">./</span>array<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">357</span>
 <span class="pl-k">in</span> <span class="pl-c1">collect</span>(<span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{Array{Any,1},##193#195}}</span>) at <span class="pl-k">./</span>array<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">273</span></pre></div>
<p dir="auto">Or a list of triples (a,b,a+b) where 1&lt;=a&lt;b&lt;5 and a+b is prime:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; [(a,b,c) for a=1:5 for b=a+1:5 for c in [a+b] if isprime(c)]
ERROR: ArgumentError: argument to Flatten must contain at least one iterator
 in start(::Base.Flatten{Base.Generator{UnitRange{Int64},##18#21{Int64}}}) at ./iterator.jl:599
 in next at ./iterator.jl:614 [inlined]
 in grow_to!(::Array{Tuple{Int64,Int64,Int64},1}, ::Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}, ::Tuple{Int64,Base.Flatten{Base.Generator{UnitRange{Int64},##18#21{Int64}}},Tuple{Int64,Base.Generator{Filter{#isprime,Array{Int64,1}},##19#22{Int64,Int64}},Tuple{Bool,Int64,Int64}}}) at ./array.jl:364
 in grow_to!(::Array{Union{},1}, ::Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}, ::Tuple{Int64,Base.Flatten{Base.Generator{UnitRange{Int64},##18#21{Int64}}},Tuple{Int64,Base.Generator{Filter{#isprime,Array{Int64,1}},##19#22{Int64,Int64}},Tuple{Bool,Int64,Int64}}}) at ./array.jl:372
 in grow_to!(::Array{Tuple{Int64,Int64,Int64},1}, ::Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}) at ./array.jl:357
 in collect(::Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}) at ./array.jl:273"><pre class="notranslate">julia<span class="pl-k">&gt;</span> [(a,b,c) <span class="pl-k">for</span> a<span class="pl-k">=</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span> <span class="pl-k">for</span> b<span class="pl-k">=</span>a<span class="pl-k">+</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span> <span class="pl-k">for</span> c <span class="pl-k">in</span> [a<span class="pl-k">+</span>b] <span class="pl-k">if</span> <span class="pl-c1">isprime</span>(c)]
ERROR<span class="pl-k">:</span> ArgumentError<span class="pl-k">:</span> argument to Flatten must contain at least one iterator
 <span class="pl-k">in</span> <span class="pl-c1">start</span>(<span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{UnitRange{Int64},##18#21{Int64}}}</span>) at <span class="pl-k">./</span>iterator<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">599</span>
 <span class="pl-k">in</span> next at <span class="pl-k">./</span>iterator<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">614</span> [inlined]
 <span class="pl-k">in</span> <span class="pl-c1">grow_to!</span>(<span class="pl-k">::</span><span class="pl-c1">Array{Tuple{Int64,Int64,Int64},1}</span>, <span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}</span>, <span class="pl-k">::</span><span class="pl-c1">Tuple</span>{Int64,Base<span class="pl-k">.</span>Flatten{Base<span class="pl-k">.</span>Generator{UnitRange{Int64},<span class="pl-c"><span class="pl-c">#</span>#18#21{Int64}}},Tuple{Int64,Base.Generator{Filter{#isprime,Array{Int64,1}},##19#22{Int64,Int64}},Tuple{Bool,Int64,Int64}}}) at ./array.jl:364</span>
 <span class="pl-k">in</span> <span class="pl-c1">grow_to!</span>(<span class="pl-k">::</span><span class="pl-c1">Array{Union{},1}</span>, <span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}</span>, <span class="pl-k">::</span><span class="pl-c1">Tuple</span>{Int64,Base<span class="pl-k">.</span>Flatten{Base<span class="pl-k">.</span>Generator{UnitRange{Int64},<span class="pl-c"><span class="pl-c">#</span>#18#21{Int64}}},Tuple{Int64,Base.Generator{Filter{#isprime,Array{Int64,1}},##19#22{Int64,Int64}},Tuple{Bool,Int64,Int64}}}) at ./array.jl:372</span>
 <span class="pl-k">in</span> <span class="pl-c1">grow_to!</span>(<span class="pl-k">::</span><span class="pl-c1">Array{Tuple{Int64,Int64,Int64},1}</span>, <span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}</span>) at <span class="pl-k">./</span>array<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">357</span>
 <span class="pl-k">in</span> <span class="pl-c1">collect</span>(<span class="pl-k">::</span><span class="pl-c1">Base.Flatten{Base.Generator{UnitRange{Int64},##17#20}}</span>) at <span class="pl-k">./</span>array<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">273</span></pre></div>
<p dir="auto">Oops, that last value of <code class="notranslate">a</code> let to an empty range for <code class="notranslate">b</code>, better skip it:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; [(a,b,c) for a=1:4 for b=a+1:5 for c in [a+b] if isprime(c)]
5-element Array{Tuple{Int64,Int64,Int64},1}:
 (1,2,3)
 (1,4,5)
 (2,3,5)
 (2,5,7)
 (3,4,7)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> [(a,b,c) <span class="pl-k">for</span> a<span class="pl-k">=</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">4</span> <span class="pl-k">for</span> b<span class="pl-k">=</span>a<span class="pl-k">+</span><span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span> <span class="pl-k">for</span> c <span class="pl-k">in</span> [a<span class="pl-k">+</span>b] <span class="pl-k">if</span> <span class="pl-c1">isprime</span>(c)]
<span class="pl-c1">5</span><span class="pl-k">-</span>element Array{Tuple{Int64,Int64,Int64},<span class="pl-c1">1</span>}<span class="pl-k">:</span>
 (<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>)
 (<span class="pl-c1">1</span>,<span class="pl-c1">4</span>,<span class="pl-c1">5</span>)
 (<span class="pl-c1">2</span>,<span class="pl-c1">3</span>,<span class="pl-c1">5</span>)
 (<span class="pl-c1">2</span>,<span class="pl-c1">5</span>,<span class="pl-c1">7</span>)
 (<span class="pl-c1">3</span>,<span class="pl-c1">4</span>,<span class="pl-c1">7</span>)</pre></div>