无法运行python脚本 - ImportError:没有名为'_chipset'的模块

时间:2015-04-15 07:37:51

标签: python linux python-3.x

我正在尝试运行quick_dump.py,它是intel-gpu-tools的成员脚本;每次我输入的东西:

$sudo python3 quick_dump.py

我得到这个输出:

Traceback (most recent call last):
  File "/usr/local/bin/chipset.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_chipset', [dirname(__file__)])
  File "/usr/lib/python3.4/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_chipset'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "quick_dump.py", line 17, in <module>
    import chipset
  File "/usr/local/bin/chipset.py", line 28, in <module>
    _chipset = swig_import_helper()
  File "/usr/local/bin/chipset.py", line 20, in swig_import_helper
    import _chipset
ImportError: No module named '_chipset'

...我怀疑python版本或依赖lib存在问题,或者我调用脚本的方式不正确或者我不知道......所以我确实需要你的帮助如何找出原因和 修复问题以使脚本可以启动

编辑:

  

chipset.i应该驻留在同一目录

我下载源代码并转到tools / quick_dump文件夹(有chipset.i)然后我尝试启动脚本:$sudo python3 quick_dump.py 但我得到了这个输出:

Traceback (most recent call last):
  File "quick_dump.py", line 17, in <module>
    import chipset
  File "/home/.../quick_dump/intel-gpu-tools/tools/quick_dump/chipset.py", 

    line 28, in <module>
        _chipset = swig_import_helper()
      File "/home/.../quick_dump/intel-gpu-tools/tools/quick_dump/chipset.py", line 24, in swig_import_helper
        _mod = imp.load_module('_chipset', fp, pathname, description)
      File "/usr/lib/python3.4/imp.py", line 243, in load_module
        return load_dynamic(name, filename, file)
    ImportError: /home/.../quick_dump/intel-gpu-tools/tools/quick_dump/_chipset.so: undefined symbol: _Ux86_64_getcontext

P.S。 OS linux

由于

1 个答案:

答案 0 :(得分:0)

chipset.i应位于同一目录中。