2016-08-18 6 views
2

MinGW-w64 프로젝트의 gdborig.exe (https://sourceforge.net/p/mingw-w64/discussion/723798/thread/4a8a9ed5/?limit=25)의 임베디드 Python 인터프리터에 문제가 있습니다.임베디드 파이썬 인터프리터가 C 모듈을 가져 오지 못함

모듈 itertools 및 여러 모듈 가져 오기가 실패합니다. 그러나 분산 된 독립형 파이썬 인터프리터에 해당하는 수입은 잘 작동 : 임베디드 파이썬 인터프리터와

>>> import sys 
>>> print sys.version 
2.7.9 (default, Jul 11 2016, 16:32:13) 
[GCC 6.1.0] 
>>> print sys.executable 
C:/AUEMARK/Programme/MinGW64/mingw64/opt/bin/python.exe 
>>> import itertools 
>>> itertools 
<module 'itertools' from 'C:\AUEMARK\Programme\MinGW64\mingw64\opt\libpython2.7\lib-dynload/itertools.pyd'> 

:

(gdb) python import sys 
(gdb) python print sys.version 
2.7.9 (default, Jul 11 2016, 16:32:13) 
[GCC 6.1.0] 
(gdb) python print sys.executable 
C:/AUEMARK/Programme/MinGW64/mingw64/opt/bin/python.exe 
(gdb) python import itertools 
Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
ImportError: No module named itertools 
Error while executing Python code. 

수 :

  • 수입 SYS
  • 수입 OS

는 할 수 없습니다

  • 수입 itertools에게
  • 수입 컬렉션
  • ...

    (gdb) python import collections 
    Traceback (most recent call last): 
        File "<string>", line 1, in <module> 
        File "C:\AUEMARK\Programme\MinW64\mingw64\opt\lib\python2.7/collections.py", line 8, in <module> 
        from _collections import deque, defaultdict 
    Importerror: no module named _collections 
    Error while executing Python code. 
    

    그래서이 포함 된 인터프리터처럼 보인다 컬렉션의 수입

오류 메시지 C에서 모듈을 가져올 수 없습니다. 파이썬 모듈을 가져오고, C 모듈의 파이썬 부분도 가져올 수 있습니다. 임베디드 인터프리터가 액세스합니다.

어떤 힌트를 주셔서 감사합니다. 어떻게이 문제를 해결할 수 있습니까?

마르쿠스

답변

0

나는 itertools.pyd를 찾을 수 없습니다 파일 때문에이 문제가있는 것 같아요. 파이썬 인터프리터

PYTHONPATH=C:/AUEMARK/Programme/MinGW64/mingw64/opt/lib/python2.7;C:\AUEMARK\Programme\MinW64\mingw64\lib\python2.7\lib-dynload 

내 PYTHONHOME 변수 포인트 : 난 내 자신의 GDB를 구축

PYTHONHOME=C:\msys64\mingw64\bin\pyhon.exe 

사용자가 설정해야합니다 귀하의 경우에는

PYTHONPATH=C:\msys64\mingw64\lib\python2.7;C:\msys64\mingw64\lib\python2.7\lib-dynload; 

: 나는 환경 변수를 설정했다 msys2에서 작동합니다 :

Microsoft Windows [Version 10.0.16299.19] 
(c) 2017 Microsoft Corporation. All rights reserved. 

C:\Users\tiit>C:\msys64\home\tiit\gdb-7.11-bin\bin\x86_64-linux-gnu-gdb.exe 
GNU gdb (GDB) 7.11.1.20160801-git 
Copyright (C) 2016 Free Software Foundation, Inc. 
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html> 
This is free software: you are free to change and redistribute it. 
There is NO WARRANTY, to the extent permitted by law. Type "show copying" 
and "show warranty" for details. 
This GDB was configured as "--host=x86_64-w64-mingw32 --target=x86_64-linux-gnu". 
Type "show configuration" for configuration details. 
For bug reporting instructions, please see: 
<http://www.gnu.org/software/gdb/bugs/>. 
Find the GDB manual and other documentation resources online at: 
<http://www.gnu.org/software/gdb/documentation/>. 
For help, type "help". 
Type "apropos word" to search for commands related to "word". 
(gdb) 

올바른 환경 변수를 설정하지 않고도 동일한 문제가 발생했습니다.