dwifslpreproc: [ERROR] TypeError: decode() takes no keyword arguments
If I search for that specific error online, the only hits I get relate to Python 2.6, which we explicitly do not support (it’s far too old…). Can you double-check which version of python you have running, e.g. using:
If it’s anything older than 2.7, then that’s the reason for the failure - you’ll need to use a more up to date version, preferably python >3.6 (I think). Note that we will stop supporting versions of python older than 3.6 in the next release…
OK, that’s really weird. That version should be fine, but your error message is definitely suggestive of an older python version. Can we try setting up a small test python script to see what it reports?
Try this copy/pasting this as-is exactly into the terminal, and press enter:
That’s indeed the line that causes the exception to be raised, yes. It’s saying that the .decode() method doesn’t expect named arguments. And as you can see from the official Python docs, support for named arguments was added to this method in version 2.7… Which is why I’m struggling to understand what might be going on. Things are a bit different in version 3.7, in that we’re relying on the decode() method from the bytes class rather than the str class, but it should also work fine – though I note that support for keyword arguments was added to that method in version 3.1. But since both relevant versions you quote are 3.7.3 or 3.10.4, that doesn’t apply either.
So I still think the evidence suggests that an old version of python is being used for some reason, though I’m not sure how or why.
To totally rule this out, would you mind adding this line near the end of the dwifslpreproc file (which you’ll find in the bin/ folder of your MRtrix install), trying your command again as you did when it last failed, and double-checking which version is being used in that context?
# Execute the script
print (sys.version_info) # <= add this line
mrtrix3.execute() #pylint: disable=no-member
Asked the person in charge of the linux system to add the following to the script and setting up to rerun to get an idea of the system error.
I got the following…
dwifslpreproc -force dwi_denoised_unringed.mif dwi_prep.mif -rpe_header
sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
dwifslpreproc: Note that this script makes use of commands / algorithms that have relevant articles for citation; INCLUDING FROM EXTERNAL SOFTWARE PACKAGES. Please consult the help page (-help option) for more information.
mrinfo: [ERROR] failed to open key/value file "/a/ha-nfs-2-ib/export/data/bswift-1/dcallow/Diffusion/dwi_denoised_unringed.mif": No such file or directory
mrinfo: [ERROR] error opening image "/a/ha-nfs-2-ib/export/data/bswift-1/dcallow/Diffusion/dwi_denoised_unringed.mif"