Install a specific Mrtrix3 version

I would like to know if there is a way to install a specific Mrtrix3 release (and older one) and not the latest one.

Yes, but it’ll depend on how you want to install it. Are you after a precompiled version or from source? If precompiled, which method do you need to use? Or rather which, which method have you used for your current version?

I have installed Mrtrix3 through conda package

OK, conda actually supports this out of the box. The way to do it (as far as I understand it) is to set up a new conda environment, with the specific versions of the package you’re interested in within that. For example, if you’re after version 3.0.0, this ought to do the trick (if I’ve read the instructions linked to above correctly):

conda create --name mrtrix-3.0.0 mrtrix3=3.0.0 

That’ll allow you to switch between your default environment and the new one with the older version of MRtrix with a simple conda activate mrtrix-3.0.0 (assuming that’s what you’ve called your new environment), and you can return to your default environment with conda activate.

Of course, this only works for MRtrix versions 3.0.0 and above - we didn’t provide pre-compiled packages before that point. If you need older versions, then you’ll need to compile them from source. I can provide instructions for that too, if you need them – let me know.

1 Like

I will try this way, thank you

Using conda environment creation produces this error:

 conda create -n mrtrix-3.0.0 mrtrix3=3.0.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - mrtrix3=3.0.0

Current channels:


To search for alternate channels that may provide the conda package you're
looking for, navigate to

and use the search bar at the top of the page.

I will try to insoect why this happens

Sorry, forgot you had to also specify the mrtrix3 channel. Try this:

conda create -n mrtrix-3.0.0 -c mrtrix3 mrtrix3=3.0.0

This works, thank you
However, I unfortunately realised I need a release before 3.0.0.
So I will need to install it from source
Thank you

OK, in this case the process is outlined in the docs. Once you’ve installed the dependencies, These commands should do the trick (amend the folder name to whatever makes sense for you):

Clone the GitHub repo into a sensibly named folder

I recommend you name it after the version you’re interested in:

git clone mrtrix-3.0_RC3

Checkout the particular version you’re interested in

See the full list here - you’re interested in the tag name, shown to the side of each release

git checkout 3.0_RC3

Configure and build:

./configure && ./build

Add this version to your PATH on demand

I don’t recommend you run the ./set_path script at this point, since this will make that version hard-coded as the default. Better to insert that version into your PATH as needed for your session, using this command:

export PATH=~/mrtrix-3.0_RC3:bin:$PATH

You can copy/paste that into your terminal when you want that session to use that version. It will apply until that shell/terminal is closed, and won’t affect other sessions. Obviously, you may need to amend the exact folder name and location if you’ve named it differently.

You can repeat that for any other versions you may want to install.

Perfect, so do I need to install all the dependencies manually?
thank you

Yes. I would also strongly recommend you do this outside of anaconda. It’s very difficult to get MRtrix to compile within anaconda…

1 Like