Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何建立标准图书馆_Python_Import_Shared Libraries_Static Libraries_Python Import - Fatal编程技术网

Python 如何建立标准图书馆

Python 如何建立标准图书馆,python,import,shared-libraries,static-libraries,python-import,Python,Import,Shared Libraries,Static Libraries,Python Import,我想在python中使用“kconfiglib”,但在执行时会得到一个“ImportError”。Kconfiglib附带了以下示例: #! /bin/python # Prints the names of all symbols that reference a particular symbol. (There's # also a method get_selected_symbols() for determining just selection # relations.) imp

我想在python中使用“kconfiglib”,但在执行时会得到一个“ImportError”。Kconfiglib附带了以下示例:

#! /bin/python
# Prints the names of all symbols that reference a particular symbol. (There's
# also a method get_selected_symbols() for determining just selection
# relations.)

import kconfiglib
import sys

conf = kconfiglib.Config(sys.argv[1])

x86 = conf["X86"]
for sym in conf:
    if x86 in sym.get_referenced_symbols():
        print sym.get_name()
运行此命令时,会出现以下错误:

ImportError: no module named kconfiglib
所以我猜kconfiglib不是作为标准库安装的。但是我怎样才能改变它呢?我在互联网上寻找解决方案,但它们主要是关于无法导入的类似库,他们的解决方案通常是安装一个新的“rpm”。但至少kconfiglib没有rpm

因此,我需要一个解决方案,以“硬代码”的方式来实现这一点。有人有主意吗


感谢您的支持

我不得不用python调用脚本,而不是作为shell调用:


--->python/script/script.py的路径

您尝试了吗?您可能需要先安装。这会导致更令人不安的错误消息实际上我的问题没有得到回答,但问题已经解决