Thank you for your help. I tried experimenting with LOAD_PATH a bit before 
I made this post and I couldn't get it to work. Here's an example - I have 
previously using Pkg.add() to add PyPlot to ~/.julia/gcc. However, if I try 
adding that directory to LOAD_PATH (via environment variables) then I am 
not able to use PyPlot:

[username@nrlogin1 01/15 09:38:08 ~]$ export JULIA_LOAD_PATH="/home/username
/.julia/gcc"
[username@nrlogin1 01/15 09:38:13 ~]$ ~/apps/gcc/5.2.0/julia/0.4.2/bin/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.2 (2015-12-06 21:47 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-unknown-linux-gnu

julia> LOAD_PATH
3-element Array{ByteString,1}:
 "/home/username/.julia/gcc"                                            
 "/home/username/apps/gcc/5.2.0/julia/0.4.2/local/share/julia/site/v0.4"
 "/home/username/apps/gcc/5.2.0/julia/0.4.2/share/julia/site/v0.4"      
julia> using PyPlot
ERROR: ArgumentError: PyPlot not found in path
 in require at ./loading.jl:233

julia> exit()


By contrast (mostly to show that PyPlot is indeed in that directory), 
PyPlot can be loaded and used if I set JULIA_PKGDIR to point to this 
directory:

[username@nrlogin1 01/15 09:38:22 ~]$ export JULIA_PKGDIR="/home/username
/.julia/gcc"
[username@nrlogin1 01/15 09:38:33 ~]$ ~/apps/gcc/5.2.0/julia/0.4.2/bin/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.2 (2015-12-06 21:47 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-unknown-linux-gnu

julia> using PyPlot

julia> plot(1:100,sort(rand(100,)))
1-element Array{Any,1}:
 PyObject <matplotlib.lines.Line2D object at 0x7fa981029390>

julia> close("all")

julia> exit()


The latter obviously won't work for what I want to do since I want users to 
be able to have their own PKGDIR where they can add packages that they 
need. Am I doing something incorrectly? 

Side note: If I do end up getting LOAD_PATH to work as you say, I suppose 
installing the global packages to one of the directories prepopulated into 
LOAD_PATH would be the "best practice"?

"/home/username/apps/gcc/5.2.0/julia/0.4.2/local/share/julia/site/v0.4"
"/home/username/apps/gcc/5.2.0/julia/0.4.2/share/julia/site/v0.4"      



On Thursday, January 14, 2016 at 10:34:14 PM UTC-5, Yichao Yu wrote:
>
> On Thu, Jan 14, 2016 at 10:26 PM, Tony Kelman <[email protected] 
> <javascript:>> wrote: 
> > You can add system-wide packages to LOAD_PATH while keeping the local 
> > Pkg.dir (maybe modify the JULIA_PKGDIR environment variable for the 
> initial 
> > installation of the system-wide packages). Not all packages work when 
> used 
> > from outside Pkg.dir, and Pkg operations often don't see them, but you 
> can 
> > try and see what works vs what doesn't. 
>
> Most packages I've tested works pretty well. (Just don't expect 
> `Pkg.*` to work). It's also usually not very hard to fix if it doesn't 
> work. 
>
> > 
> > 
> > On Thursday, January 14, 2016 at 9:11:20 AM UTC-8, [email protected] 
> wrote: 
> >> 
> >> I work on a large compute cluster used by hundreds of university 
> >> researchers. Our scientific applications stack is managed via RPM. I 
> would 
> >> like to provide users with a Julia build that: 
> >> (1) Includes Julia base 
> >> (2) Provides some commonly-used secondary packages - the main ones that 
> I 
> >> have in mind right now are the plotting packages Gadfly and PyPlot and 
> >> perhaps also IJulia. But there may be others down the line. I want to 
> >> provide these centrally because many, many users will want to use them 
> and I 
> >> want to lower the barrier to entry. I also would like to figure out the 
> >> matplotlib dependencies in PyPlot for them so that they don't have to. 
> >> 
> >> The idea is to provide a base install that will be enough for many 
> users 
> >> (at least to get started); they can then use Pkg to add any other 
> packages 
> >> that they require. 
> >> 
> >> Is there a recommended method for centrally-installing packages like in 
> >> (2) while also allowing users to maintain additional packages in their 
> Home 
> >> directories? I have not been able to track down documentation for this. 
> >> 
> > 
>

Reply via email to