2016-05-19 133 views
0

我已经安装了pyxb模块常规方式(蟒蛇的setup.py安装),这里是输出:PyXB模块无法识别

Found bundle in pyxb/bundles/common 
Found bundle in pyxb/bundles/dc 
Found bundle in pyxb/bundles/wssplat 
Found bundle in pyxb/bundles/saml20 
running install 
running build 
running build_py 
running build_scripts 
running install_lib 
running install_scripts 
changing mode of /usr/local/bin/pyxbgen to 755 
changing mode of /usr/local/bin/pyxbwsdl to 755 
changing mode of /usr/local/bin/pyxbdump to 755 
running install_egg_info 
Removing /usr/local/lib/python2.7/dist-packages/PyXB-1.2.4.egg-info 
Writing /usr/local/lib/python2.7/dist-packages/PyXB-1.2.4.egg-info 

不过,我不断收到消息:

ImportError: No module named pyxb 

运行时一个包含以下内容的脚本:

import pyxb 
import pyxb.binding 
import pyxb.binding.saxer 
import StringIO 
import pyxb.utils.utility 
import pyxb.utils.domutils 

有没有人知道为什么会出现这种情况?

+0

>>>须藤PIP安装pyxb –

+0

或>>> sudo易于得到安装python-pyxb –

+0

或下载模块和开放的解释蟒蛇,并通过这条线:>> > import sys; sys.path.insert(0,“path_of_module”) –

回答

0

事实证明,这是一个权限问题:当作为sudo运行脚本时,它成功导入pyxb。 setup.py脚本安装pyxb为: drwxr-s--- 7 root staff 4096 May 19 16:30 pyxb