Installing packages system-wide

1,686 views
Skip to first unread message

Ján Dolinský

unread,
Dec 10, 2014, 8:16:04 AM12/10/14
to julia...@googlegroups.com
Hello,

I'd like to ask how to install Julia packages system-wide so that users do not have to install packages individually on their own but rather just once by an admin.

Thanks,
Jan

Stefan Karpinski

unread,
Dec 10, 2014, 10:28:15 AM12/10/14
to Julia Users
There's a Julia variable called LOAD_PATH that is arranged to point at two system directories under your julia installation. E.g.:

julia> LOAD_PATH
2-element Array{Union(ASCIIString,UTF8String),1}:
 "/opt/julia-0.3.3/usr/local/share/julia/site/v0.3"
 "/opt/julia-0.3.3/usr/share/julia/site/v0.3"

If you install packages under either of those directories, then everyone using that Julia will see them. One way to do this is to run julia as a user who can write to those directories after doing `export JULIA_PKGDIR=/opt/julia-0.3.3/usr/share/julia/site` in the shell. That way Julia will use that as it's package directory and normal package commands will allow you to install packages for everyone. Or you can just copy your installed packages and change the ownership and permissions so that everyone can access the files.

Ján Dolinský

unread,
Dec 11, 2014, 3:39:48 AM12/11/14
to julia...@googlegroups.com
There's a Julia variable called LOAD_PATH that is arranged to point at two system directories under your julia installation. E.g.:

julia> LOAD_PATH
2-element Array{Union(ASCIIString,UTF8String),1}:
 "/opt/julia-0.3.3/usr/local/share/julia/site/v0.3"
 "/opt/julia-0.3.3/usr/share/julia/site/v0.3"

If you install packages under either of those directories, then everyone using that Julia will see them. One way to do this is to run julia as a user who can write to those directories after doing `export JULIA_PKGDIR=/opt/julia-0.3.3/usr/share/julia/site` in the shell. That way Julia will use that as it's package directory and normal package commands will allow you to install packages for everyone. Or you can just copy your installed packages and change the ownership and permissions so that everyone can access the files.

Thanks for the advice!

Jan

Ján Dolinský

unread,
Jan 8, 2015, 10:08:32 AM1/8/15
to julia...@googlegroups.com
I noticed that if packages are installed system-wide than auto-completion for a regular user does not work e.g. typing
julia> using Arr
will not auto-complete "Arr" (after pressing the Tab key) to "ArrayViews". This is not the case if packages are installed in user's home directory. Is there any fix for this ?

Thanks,
Jan

Dňa streda, 10. decembra 2014 16:28:15 UTC+1 Stefan Karpinski napísal(-a):

Tim Holy

unread,
Jan 8, 2015, 10:13:40 AM1/8/15
to julia...@googlegroups.com
There's a second way to install system-wide (at least, on Unix): set the
environment variable JULIA_PKGDIR for all users. If you do it that way, tab
completion works.

Still, it would be nice if tab completion also worked with LOAD_PATH. Care to
open an issue about that?

--Tim

Ján Dolinský

unread,
Jan 9, 2015, 3:34:12 AM1/9/15
to julia...@googlegroups.com
Hi,

Thanks for the tip. How do I open an issue about this problem ?

Jan

Dňa štvrtok, 8. januára 2015 16:13:40 UTC+1 Tim Holy napísal(-a):

Ján Dolinský

unread,
Jan 9, 2015, 3:49:44 AM1/9/15
to julia...@googlegroups.com
In addition, I assume if JULIA_PKGDIR is identical for all users that everyone installs packages in the same directory (if they can write to it) which is not desired in my situation. There should be some system-wide packages available and then a user should be still able to install packages individually.


Jan

Dňa štvrtok, 8. januára 2015 16:13:40 UTC+1 Tim Holy napísal(-a):
There's a second way to install system-wide (at least, on Unix): set the

Tim Holy

unread,
Jan 9, 2015, 4:46:54 AM1/9/15
to julia...@googlegroups.com
On Friday, January 09, 2015 12:34:12 AM Ján Dolinský wrote:
> Hi,
>
> Thanks for the tip. How do I open an issue about this problem ?

https://github.com/JuliaLang/julia, then click on the "Issues" link near the
top-right. It's a kindness to busy developers to first search to see if your
issue has been reported previously (I haven't done so for this problem, so
please do).

--Tim

Ján Dolinský

unread,
Jan 9, 2015, 9:50:21 AM1/9/15
to julia...@googlegroups.com
All right.

Dňa piatok, 9. januára 2015 10:46:54 UTC+1 Tim Holy napísal(-a):

Daniel Høegh

unread,
Jan 9, 2015, 1:17:33 PM1/9/15
to julia...@googlegroups.com
I have made a pull-request on it. See https://github.com/JuliaLang/julia/pull/9699

Ján Dolinský

unread,
Jan 12, 2015, 7:50:21 AM1/12/15
to julia...@googlegroups.com
Excellent, thanks a lot!

Jan

Dňa piatok, 9. januára 2015 19:17:33 UTC+1 Daniel Høegh napísal(-a):
Reply all
Reply to author
Forward
0 new messages