Get an array or just a string of all installed Julia packages

204 views
Skip to first unread message

le...@neilson-levin.org

unread,
Oct 10, 2015, 3:47:02 PM10/10/15
to julia-users
I would like to generate a list of all the packages I've installed.  Each time I install Julia (which I've done a lot recently, but will settle down now that 0.4.0 is released--Yeah!) I need to install packages again.  It would be nice to have a list.  It would be nicer to be able to install them as a batch, but since makes take a long time and can be fragile I am OK without a batch.

Basically, I want pip freeze > mypkgs.txt within the Julia repl.  Unfortunately, since Pkg.status is ::void it produces no output to capture.  I tried pipeline.  No go.

Should be easy;  seems an obvious request.  Writing a little Julia script is a fine solution, but without being able to capture Pkg.status not sure what it would look like.

Thanks

Michael Hatherly

unread,
Oct 10, 2015, 3:57:20 PM10/10/15
to julia-users

Pkg.installed() returns the currently installed packages and the REQUIRE file found in your .julia/0.4/ folder lists all the explicitly installed packages. So if you copy that file over to a fresh package directory and run Pkg.resolve() that should install everything that you’d need.

— Mike

Tim Holy

unread,
Oct 11, 2015, 6:08:12 AM10/11/15
to julia...@googlegroups.com
Try this:
(new installation) Pkg.init()
cp OldInstallation/.julia/v0.4/REQUIRE NewInstallation/.julia/v0.4/
(new installation) Pkg.update()

As for your original question, collect(keys(Pkg.installed())) should do what
you ask.

--Tim

le...@neilson-levin.org

unread,
Oct 11, 2015, 12:20:21 PM10/11/15
to julia-users
Great.  Thanks.

When you say (new installation) Pkg.update()     what is (new installation) on the command line?  Does it mean cd over there first?
Reply all
Reply to author
Forward
0 new messages