PyXB模块无法识别

时间:2016-05-19 15:04:05

标签: pyxb

我已经安装了pyxb模块常规方式(python setup.py install),这里是输出:

viewPager.addOnLayoutChangeListener(new ViewPager.OnLayoutChangeListener() {
  @Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
      for (int i = 0; i < tabLayout.getTabCount(); i++) {
          if (tabLayout.getTabAt(i).getCustomView() == null) {
              tabLayout.getTabAt(i).setCustomView(tabs[i]);
          }
      }
  }
}

然而,我不断收到消息:

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

有谁知道为什么会这样?

1 个答案:

答案 0 :(得分:0)

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