-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dcm2bids_scaffold: FileNotFoundError: dcm2bids/scaffold/dataset_description.json #110
Comments
I confirm I am getting the same error on a fresh installation of dcm2bids with python 3.8 on Ubuntu 20.04. |
I can also confirm that I get the same error on a fresh installation of dcm2bids with python 3.9.1 on macOS Big Sur version 11.1. |
DebuggingIndeed, this file doesn't appear anywhere in the package:
It's not even in the src package:
The fixThis is a common issue with python packaging. So common so I would almost call it a bug in pip/setuptools. Until there's a better default every python programmer needs to know about
You should also use this stdlib's API to access it. Instead of:
use
Now, there's a catch here: because python's package system supports virtual packages and remote packages and zipped packages (not that anyone ever ever uses those features) you cannot get a filename from this API, because there isn't necessarily a file to give. As the docs say:
So you need to deal with that: you can't use alternate solutionsbtw there was also Apparently you can also use
L'avenirBecause of another quirk of python, your tests won't catch this until you publish and have a broken package. It's important to always do python tests on the installed package (here's more of the same advice). I have the same concern in SCT: spinalcordtoolbox/spinalcordtoolbox#3161. We wrote a custom package manager instead of using pip to distribute assets which forces us to test our installed version (our tests won't work until you |
Oh wait actually maybe |
Thanks for reporting the issue @ArnaudC and @marleenhaupt. This is simply to let you know that the bug was fixed, thanks to @kousu and @arnaudbore :). |
Hello,
The steps to reproduce :
As you can see, there is no file called dataset_description.json.
This was working last month.
Thanks
The text was updated successfully, but these errors were encountered: