ERROR: Unsatisfiable requirements detected for package HDF5 [f67ccb44]

I tried to ]rm HDF5 and then ]add HDF5. But here is what it showed

Can anyone help on this? Thank you so much!

You seem to be on Julia 1.0, which is quite an old version that many packages don’t support any longer - I would recommend updating to 1.6.3.

Also you seem to be installing all packages into your default environment - don’t do this, use package specific dependencies instead.

Thanks. I will update to 1.6.3.

Re “use package specific dependencies instead”, could you pls elaborate on this? Thank you!

Environments allow you to specify a particular set of Julia packages (with specific versions) for a given project. When you use the default environment and install a large number of packages, you are more likely to have a conflict between dependencies. For example, Package A might require the version of Package C to be less than or equal to 2.0, while Package B requires the version of Package C to be greater than or equal to 3.0. By only including the packages a particular project requires, you’ll probably find you have fewer dependency conflicts.

Let’s say I want to make a new environment for my project in directory MyProject which uses DataFrames and CSV.

From the shell:

mkdir MyProject
cd MyProject

From the Julia REPL:

using Pkg

The single argument for Pkg.activate is the path to the project directory, and if you started Julia from the project directory, then it’s simply the current working directory: ".". You should now see that there are two files in MyProject, Project.toml and Manifest.toml. The former is a list of the declared dependencies of the project and looks like this:

CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"

The Manifest.toml file contains all of the direct and indirect dependencies, along with their specific versions. Normally, you don’t have to edit these files directly, that’s what the Pkg module is used for.

In any Julia script that you write that you want to use these dependencies, you simply activate the project environment at the beginning, for example:

using Pkg
using DataFrames
using CSV
df ="some_table.csv", DataFrame)

While it is a little more overhead to get started with a project environment, it makes things so much easier to reproduce the same results you got when you last left the project (potentially months or years later).

You can find more information about environments in the documentation here:

1 Like