Managing project dependencies
In the Managing packages recipe in Chapter 1, Installing and Setting Up Julia, we explained how you can install and remove packages in the global environment.
However, when you develop your own application, you often need to have precise control over its dependencies. In this recipe, we explain how Julia supports this requirement.
Getting ready
Create a new folder on your computer and start the Julia command line in this folder. Running the pwd()
command should return the path to the folder in which you want to create your project.
Make sure that the folder is empty. You can check it, for example, by running isempty(readdir())
, which should return true
.
Also, make sure that the StaticArrays
package is not installed. Running the using StaticArrays
command should throw the following error:
julia> using StaticArrays
ERROR: ArgumentError: Package StaticArrays not found in current path:
- Run `import Pkg; Pkg.add("StaticArrays")` to install the StaticArrays package...