本文介绍了python找不到pydicom模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误消息:

在[1]中:

import pydicom as dicomio
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-102814c2908e> in <module>()
----> 1 import pydicom as dicomio

ImportError: No module named pydicom

要安装我用过的pydicom

To install pydicom I used

conda skeleton pypi pydicom
conda build pydicom

然后将其上传到binstar,并使用conda install -c重新下载并安装它.现在可以在anaconda环境中看到它.

Then uploaded to binstar and used conda install -c to download and install it again. It can now be seen in the anaconda environment.

Lindas-iMac:~ iMacLinda$ conda list -e | grep pydi
pydicom=0.9.9=py27_0

谢谢您的帮助.

推荐答案

在版本0.9.9之前,pydicom软件包可作为dicom导入.阅读文档的文档用于未发布的master分支版本1.0,其中包名称已更改为pydicom.

The pydicom package is importable as dicom until version 0.9.9. The documentation on read the docs is for the unreleased master branch version 1.0, in which the package name has changed to pydicom.

因此,尝试将pydicom导入为:

Thus, try importing pydicom as:

import dicom

如果需要读取文件,可以使用以下命令:

If you need to read a file, you can use the command:

ds = dicom.read_file('filename.dcm')

一旦pydicom 1.0发布,您可以按照维基页面有关移植说明.

Once pydicom 1.0 is released, you can follow the wiki page for porting instructions.

这篇关于python找不到pydicom模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-02 20:52