Skip to content

ImportError: No module named dicom #350

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

Closed
MadsJensen opened this issue Oct 1, 2015 · 7 comments
Closed

ImportError: No module named dicom #350

MadsJensen opened this issue Oct 1, 2015 · 7 comments

Comments

@MadsJensen
Copy link

Hi,
I get the following error trying to load dicom files with nibabel. The files are from a Siemens Skyra.

data,affine,bvals,bvecs = read_mosaic_dwi_dir(dcm_dir)
Traceback (most recent call last):

File "<ipython-input-8-40e949d760f1>", line 1, in <module>
  data,affine,bvals,bvecs = read_mosaic_dwi_dir(dcm_dir)

File "/home/mje/Toolboxes/anaconda/lib/python2.7/site-packages/nibabel/nicom/dicomreaders.py", line 44, in read_mosaic_dwi_dir
  dicom_kwargs=dicom_kwargs)

File "/home/mje/Toolboxes/anaconda/lib/python2.7/site-packages/nibabel/nicom/dicomreaders.py", line 89, in read_mosaic_dir
  dcm_w = wrapper_from_file(fname, **dicom_kwargs)

File "/home/mje/Toolboxes/anaconda/lib/python2.7/site-packages/nibabel/nicom/dicomwrappers.py", line 52, in wrapper_from_file
  import dicom

ImportError: No module named dicom

I have pydicom install, any ideas what the problem might be?

best wishes,
mads

@matthew-brett
Copy link
Member

What do you get for:

python -c 'import dicom'

How did you install pydicom? Is it possible that you installed it with pip and the pip you used was not the one from Anaconda?

@moloney
Copy link
Contributor

moloney commented Oct 1, 2015

I am guessing it is due to pydicom 1.0 being installed. The module name changes from "dicom" to "pydicom": https://github.com/darcymason/pydicom/wiki/Porting-to-pydicom-1.0

@moloney
Copy link
Contributor

moloney commented Oct 2, 2015

Hmm, sorry for the noise. I guess 1.0 isn't quite out yet.

@MadsJensen
Copy link
Author

@matthew-brett I get:
python -c 'import dicom'
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named dicom

@moloney yes I have pydicom 1.0 from git installed.

I tried with the pip version as well, but that didn't work either. But it was the anaconda pip, so it sounds like that is why.

@moloney
Copy link
Contributor

moloney commented Oct 2, 2015

The code needs to be update to work with pydicom 1.0, but should work with 0.99 and earlier.

@MadsJensen
Copy link
Author

thanks, I fixed the pydicom version and it works.

@matthew-brett
Copy link
Member

I made a new issue for this, just so we don't forget: #351

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

3 participants