cx_freeze로 컴파일하려고 할 때 가져 오기 오류 가져 오기
문제
i에서 만든 모듈이있는 여러 파이썬 파일이 있습니다.파일은 모듈에 대해 서로 의존합니다.
현재 하나의 폴더에 모두
main.py
readfile.py
pronunciation.py
meaning.py
classes.py
.
사용한 유일한 모듈은 INBUILT 임의의 무작위로 (둘 중 하나를 추가하는 방법을 모르겠습니다)입니다.여기 내 현재 코드
입니다from cx_Freeze import setup,Executable
includefiles = []
includes = ['classes.py','pronunciation.py','readfile.py','meaning.py']
excludes = []
packages = []
setup(name = 'Revision',
version = '0.1',
description = 'Revision program for studying',
author = '',
author_email = '',
options = {'build_exe': {'includes': includes,'excludes':excludes,'packages':packages,'include_files':includefiles}},
executables = [Executable('main.py')])
.
이후 모듈 classes.py가 존재하지 않는다는 것을 말하면서 ImportError가 발생합니다. (의미를 의미합니다), 어떻게 해결합니까?또한 cx_freeze가 무작위로 가져올 수 없다고 걱정합니다.
Windows에도 있습니다. BTW.
해결책
를 교체하려고합니다.
includes = ['classes.py','pronunciation.py','readfile.py','meaning.py']
.
includes = ['classes','pronunciation','readfile','meaning']
.
이 목록에는 빌딩 중에 가져올 모듈이 들어 있습니다. 파이썬에서 우리는 가져 오기에 * .py 확장을 지정하지 않습니다.
btw.파이썬의 용어 * .py 파일= 모듈, 동일합니다.
제휴하지 않습니다 StackOverflow