-
Notifications
You must be signed in to change notification settings - Fork 12
Setting up your environment
bsuwal edited this page Sep 18, 2020
·
5 revisions
- Install Julia. You can find a link to the appropriate installer at https://julialang.org/downloads/.
-
Check to make sure you can run Julia from the command line. Open up a Terminal/Command Prompt and type
juliaand press Enter. If this results in an error instead of the Julia interpreter, there may be aPATHissue. You can find official instructions on how to add Julia to yourPATHat this page. (N.B. If you are using Windows, the full path you should be adding to your path should look something like this:C:\Users\[username]\AppData\Local\Programs\Julia\Julia-[version]\bin.) - Install a code editor. For development in Julia, we recommend Juno, which requires the installation of Atom. You can find instructions on the steps to install Juno here.
-
Check that you can run the Julia REPL in Atom. Open Atom and then click
Juno > Open REPL. If you see an error, you may need to navigate toJuno > Settingsand change the Julia Path to the appropriate location. This should allow you start the Julia interpreter from the REPL.
We highly recommend you use a virtual environment for development in your projects. Virtual Environments can be easily set up using Julia's builtin package manager Pkg.
- Type
juliainto your command line to start the julia interpreter. - Type
using Pkg; Pkg.activate("NameOfEnvironment"; shared=true). This creates a virtual environment with the nameNameOfEnvironment(you should pick a snazzier name!). - Type
Pkg.add("GerryChain"). After the package has been installed you can exit out of the interpreter by typingexit(). You have successfully installedGerryChainin your virtual environment! - Optional: If you want to code on Jupyter Notebook, also type in
Pkg.add("IJulia")on the julia console. Next time you dojupyter notebook, you will see an option under theNewtab to start a Julia notebook. - When you run a script or want to use GerryChain through Jupyter notebooks, you will want to start your script/notebook with
using Pkg; Pkg.activate("NameOfEnvironment"; shared=true)
using GerryChain
You are all set to go!