Skip to content
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

import failure with pydicom 3.x in dicomparser.py #385

Closed
sjswerdloff opened this issue Jan 26, 2025 · 2 comments
Closed

import failure with pydicom 3.x in dicomparser.py #385

sjswerdloff opened this issue Jan 26, 2025 · 2 comments

Comments

@sjswerdloff
Copy link

The API in pydicom 3.x has changed with respect to 2.4.x (not surprising, given major version bump).

I believe the failure is happening in dicomparser.py

try:
    from pydicom.dicomio import read_file
    from pydicom.dataset import Dataset, validate_file_meta
    from pydicom.pixel_data_handlers.util import pixel_dtype
except ImportError:
    from dicom import read_file
    from dicom.dataset import Dataset

where the first try at importing (presumably pydicom 2.x API) fails, it goes to the except clause, and then reports not finding "dicom".

Is there a preference for trying to cascade the import attempts with a new starting API that matches pydicom 3.x or just pin pydicom in the range >=2.4 , <= 3.0?

I'll give the former a try if there's interest.

@darcymason
Copy link
Contributor

Hi Stuart, this was updated (issue #380, pr #384 and related) so that dicompyler-core is pinned for pydicom >=2.4,<4.0.

@sjswerdloff
Copy link
Author

Hi Stuart, this was updated (issue #380, pr #384 and related) so that dicompyler-core is pinned for pydicom >=2.4,<4.0.

not released yet on PyPI... ok. I've pinned pydicom to 2.4.4 in the branch on the project I'm working on (OnkoDICOM), but I'll set the version for dicompyler-core to be ready for 0.5.7 when it becomes available (and then I'll try to unpin pydicom).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants