2017-12-14 3 views
0

SWIG가 C 코드에서 생성 한 일부 Python 인터페이스 모듈의 문서를 생성하려고합니다. I는 게시 한 바와 같이 (* .I) SWIG 인터페이스 파일 %feature(docstring) 지시자를 사용하고 : 의도 Sphinx and documenting python from a swigged C++ apiSphinx-build는 SWIG가 python 모듈을 가져올 때 생성 된 python 파일에 대해 오류를 생성합니다.

SWIG 생성 된 파이썬 모듈 문서화 문자열을 생성한다. 나는 그것이 예외를 던지고 꿀꺽 꿀꺽 생성 된 파이썬 모듈에서 문서를 생성하려고 할 때

는하지만 :

/home/imitra/testdoc/doc/test_module.rst:4: WARNING: autodoc: failed to import module u'test_module'; the following exception was raised: 
Traceback (most recent call last): 
    File "/home/imitra/.local/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 658, in import_object 
    __import__(self.modname) 
    File "/home/imitra/testdoc/generated/test_module.py", line 3, in <module> 
    _test_module = swig_import_helper() 
    File "/home/imitra/testdoc/generated/test_module.py", line 25, in swig_import_helper 
    return importlib.import_module('_test_module') 
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
ImportError: No module named _tiger 

을 스핑크스가 test_module.py를 가져올으로 이러한 문제가 발생하고, SWIG는 코드가 실행됩니다 생성.

이 문제를 해결할 수있는 방법이 있습니까? 나는 SWIG와 스핑크스의 초보자입니다. 의견을 보내주십시오.

+0

'_tiger'을 (를) 찾을 수 없거나 가져올 수 없습니다. 모듈을 가져올 수 있습니까? 그렇지 않으면 스택 추적을 통해 어디에서 호출되는지 확인합니다. –

+0

SOLVED : Thanks Steve 나는 sys.path에 넣기 위해 SWIG를 사용하여 포장 한 * .so 파일 하나를 놓쳤다. 스핑크스가 모듈을로드하지 못했습니다. –

답변

0

requirements.txt -file을 업데이트하는 것을 잊었을 때와 마찬가지로 ReadTheDocs.io에서 비슷한 오류 (Sphinx를 구축 할 때)가 발생합니다. 그런 다음 RTD는 모든 종속성을 설치하지 않습니다.

C + + 또는 SWIG와 관련하여 스핑크스에 대해 많이 알지 못하거나 문제에 해당되는 경우.

관련 문제