0

Please see this screenshot:

screenshot 1

Isn't the package pydicom already installed?

Credit to Igor: It looks like that it's working in Sublime Text 2's build using "import dicom". However it is still somehow not working in my Eclipse with PyDev environment.


***I have solved the problem in Eclipse after adding a path in the Python Interpreter configuration by hand (Somehow Auto-Config didn't add this path.).

screenshot

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
A. Z. Guo
  • 11
  • 1
  • 3
  • What is the result of `pip show pydicom`? – l'L'l Feb 10 '16 at 19:42
  • It shows the following: Metadata-Version: 1.1 Name: pydicom Version: 0.9.9 Summary: Pure python package for DICOM medical file reading and writing Home-page: http://pydicom.googlecode.com Author: Darcy Mason and contributors Author-email: darcymason@gmail.com License: MIT license Location: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages Requires: – A. Z. Guo Feb 10 '16 at 19:54
  • 1
    Use `import dicom` instead of pydicom. – Igor Feb 10 '16 at 19:57

2 Answers2

1

I did the same series of steps and saw the same issue. After digging around it looks like the package appears as "dicom". Try this instead:

import dicom

Edit: Looking at this question mentioning this library, everyone is importing it this way too.

Community
  • 1
  • 1
Igor
  • 1,212
  • 12
  • 23
  • Thank you! It looks like that it's working in Sublime Text 2's build using "import dicom". However it is still somehow not working in my Eclipse with PyDev environment. – A. Z. Guo Feb 10 '16 at 19:59
  • Hmm, try re-starting your Eclipse/clearing cache. What error are you seeing? – Igor Feb 10 '16 at 21:06
0

try:

python -m pip freeze

Is the package there? If not, you have installed it for the wrong python environment. I suggest you install it as follows:

In Bash prompt (terminal):

python -m pip install pydicom

You can change python with python3 or the absolute address of the executable. If you don't know the absolute address of the executable, you can obtain it as follows:

In Bash prompt (terminal):

which python 

(or python3). The output would be the absolute path, which you may utilise like so:

/Users/xyz/bin/python -m pip install pydicom

Finally, if you want to find out the path to your executable from within Python, you may do so like this:

from sys import executable
print(executable)

The output will be the absolute path to the current environment's interpreter.

Pouria
  • 1,081
  • 9
  • 24