HEUDICONV unable to run

Hi there!

I’ve recently had trouble running heudiconv on some new data. I had previously gotten it to work back in 2019, but when I got new data this year, it was no longer working for me.

First, I reran my previous command:
heudiconv -d path/to/dicom/files -o /path/to/output/directory -s name -ss session -f convertall.py -c dcm2niix -b --overwrite

and got the following error:
File “/path/to/heudiconv”, line 7, in
from heudiconv.cli.run import main
ModuleNotFoundError: No module named ‘heudiconv’

Which is confusing because heudiconv is indeed installed on the computing cluster I use. I tried to get around this by trying to use singularity. I ran the following command:

singularity pull docker://nipy/heudiconv:0.5.4 -d path/to/dicom/files -o /path/to/output/directory -s name -ss session -f convertall.py -c dcm2niix -b --overwrite

There seems to be a problem with pulling the container:
WARNING: pull for Docker Hub is not guaranteed to produce the
WARNING: same image on repeated pull. Use Singularity Registry
WARNING: (shub://) to pull exactly equivalent images.
ERROR Error creating path /afs/computercluster/home/username/.singularity/docker, exiting.
Docker image path: index.docker.io/nipy/heudiconv:0.5.4
Cleaning up…
ERROR: pulling container failed!

Anyone know how to solve these issue and get heudiconv to run? Any ideas would be greatly appreciated!

This likely means that HeuDiConv is not installed in the same Python environment as your default Python interpreter. If you’re on an HPC, I would recommend setting up a miniconda distribution in your home directory to give you better control. For example, I would do:

conda create -n heudiconv python=3.9
conda activate heudiconv
pip install heudiconv

Is it possible you wanted singularity run? I’ll assume that the command should have worked…

0.5.4 seems to exist on DockerHub. It may be that you don’t have permissions, or have hit a quota? On the off chance that there’s something corrupted with the 0.5.4 image, you could try rebuilding with 0.9.0.

Thank you, it worked!
There seemed to have been something wrong with my environment since last time I ran it, appreciate the help.

1 Like