On Monday, January 6, 2014 11:53:43 PM UTC+11, Alasdair McAndrew wrote:
>
> Yes, my LOAD_PATH gives very similar results.  Following some other 
> threads the commands (within Julia run as root):
>
> ENV["JULIA_PKGDIR"] = "/opt/julia/usr/share/julia/site/v0.3"
> Pkg.init()
>
> followed by a few Pkg.add's, did the trick.  However, Pkg.installed() (as 
> a user, not root) shows nothing, because the packages aren't in the user 
> directory.  As a user, I have to set JULIA_PKGDIR as for root, for the 
> packages to show up.
>
> This is all good - thank you very much!
>
> -Alasdair
>
> On Monday, January 6, 2014 6:49:08 AM UTC+11, Stefan Karpinski wrote:
>>
>> I think that's not really what's being asked for here. Julia looks in 
>> JULIA_PKGDIR, which defaults to ~/.julia, but it also looks in the paths in 
>> the LOAD_PATH global variable, which on my system defaults to this:
>>
>> julia> LOAD_PATH
>> 2-element Array{Union(UTF8String,ASCIIString),1}:
>>  "/Users/stefan/projects/julia/usr/local/share/julia/site/v0.3"
>>  "/Users/stefan/projects/julia/usr/share/julia/site/v0.3"
>>
>>
>> If you have a system-installed julia, it should have system directories 
>> in LOAD_PATH by default. Thus, you can clone package repos there and they 
>> will be found when loading packages. However, the package manager will not 
>> do this for you – unless you set JULIA_PKGDIR to one of those directories. 
>> So you may want to run julia as root and temporarily set the JULIA_PKGDIR 
>> environment variable to one of the default LOAD_PATH entries to use Pkg to 
>> install system-wide packages. After that, those packages will be visible 
>> but the package manager will consider them to be pre-installed.
>>
>>
>> On Sun, Jan 5, 2014 at 1:19 PM, Elliot Saba <[email protected]> wrote:
>>
>>> JULIA_PKGDIR is what you are looking for.
>>> On Jan 5, 2014 8:35 AM, "John Myles White" <[email protected]> wrote:
>>>
>>>> I believe there is a Julia environment variable that lets you control 
>>>> where packages will be located, but I can’t seem to recall what it is. If 
>>>> you knew that variable, you could have every user specify in the .juliarc 
>>>> that packages should be loaded from this alternative location.
>>>>
>>>>  — John
>>>>
>>>> On Jan 5, 2014, at 6:46 AM, Alasdair McAndrew <[email protected]> wrote:
>>>>
>>>> > I can install packages as myself; that's fine.  I'm just wondering if 
>>>> they can be installed centrally, so as to be available to all users.
>>>>
>>>>  
>>

Reply via email to