How to change Pkg.dir and homedir in Julia permanently?

1,510 views
Skip to first unread message

James Chen

unread,
Feb 29, 2016, 11:22:20 AM2/29/16
to julia-users
Hi,
I am trying to change Pkg.dir and homedir for Julia permanently, as the default installation set them to a net-drive in my Win7. I can use ENV[""] = to set them temporarily. However, every time I exit Julia and restart it, the Pkg.dir and homedir change back to the default net-drive directory, which is really an issue to me. 

Can anyone help me? Many thanks. 


paul.so...@gmail.com

unread,
Feb 29, 2016, 10:58:11 PM2/29/16
to julia-users

Hi, here are some things that I found out (by trial and error) and then documented on my homepage (https://sites.google.com/site/paulsoderlindecon/home/software). With some luck, it helps.

If your PC is in a university (or corporate) network, chances are that your system administrators have set some windows environment variables in a way that creates problems with installing Julia packages (for instance, by setting HOMEDRIVE to a network drive). If you encounter such problems, set the environment variable HOME to C:\Users\yourusername (you find/add it at control panel-system-advanced system settings-environment variables-user variables). In case that does not work, try this instead: create  a bat file (say, Julia.bat) containing three lines (1) set HOMEDRIVE=C: (2) set HOMEPATH=\Users\yourusername (3) D:\Julia\bin\julia.exe (or wherever it is located). Then run this bat file to use Julia. In either case, you may have to execute Pkg.init() before starting do install packages.

 

Tony Kelman

unread,
Mar 1, 2016, 6:44:57 AM3/1/16
to julia-users
You could also put these settings in a juliarc.jl startup file.

Greg Plowman

unread,
Mar 1, 2016, 7:55:48 PM3/1/16
to julia-users

James Chen

unread,
Mar 1, 2016, 8:07:50 PM3/1/16
to julia-users
The ENV variable works for me. 

Thank you very much, Paul!  Have a nice day.

James Chen

unread,
Mar 1, 2016, 8:11:35 PM3/1/16
to julia-users
Thanks for you reply, that is what I do. 

However I have to put this juliarc.jl in the net-drive, and moreover, the precompile process of a new adding package still locates in the net-drive, which is not favorable, too. As the crucial point to me is that I only have limited space of the net-drive (....4MB.....)

James Chen

unread,
Mar 1, 2016, 8:14:38 PM3/1/16
to julia-users
Thanks. 

I think Paul gives a more robust solution. It seems that Julia_home_variable (if any) is exactly the HOME environment variable for windows, in default setting. 
Reply all
Reply to author
Forward
0 new messages