Search code examples
pythondicompydicom

How to fix encoding issues of pydicom in python


This is the code:

import dicom

ds = dicom.read_file(FILE_PATH)
print(ds)

Error:

LookupError: unknown encoding: ISO 2022 IR 100

When using pydicom in order to look at data, I got the error above. I found 'ISO 2022 IR 100': 'latin_1' ,according to here.

However, I didn't get how to fix this problem. Can you help me to solve this error?


Solution

  • As indicated in the comments, the culprit was an out-of-date version of pydicom. Upgrading to a more recent version fixed this issue.