와 ImportError를,하지만 실행이 오류 가지고 : 그럼나 cx_Freeze 및 pyInstaller 중에
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
exec code in m.__dict__
File "client_test.py", line 2, in <module>
File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/__init__.py", line 53, in <module>
_checkRequirements()
File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg/twisted/__init__.py", line 37, in _checkRequirements
raise ImportError(required + ": no module named zope.interface.")
ImportError: Twisted requires zope.interface 3.6.0 or later: no module named zope.interface.
, 나는 나 cx_Freeze를 사용하여 시도,하지만 난 나는 실행을 짓고 있어요 곳에서 this example.
같은 'namespace_packages': ['zope']
를 사용하는 경우에도 정확한 같은 오류가 발생, 내가 파이썬 인터프리터와 성공적으로 수입 zope.interface를 열 수 있습니다, 나는 easy_install
를 통해 설치 한 후 pip install -U zope.interface
을 실행 나중에, 어떤 효과도 없었습니다.
여기 나 cx_Freeze 내 setup.py
입니다 :
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"excludes": ["tkinter"],
'namespace_packages':['zope'],
'append_script_to_exe':True
}
setup( name = "exetest",
version = "0.1",
description = "My first executable",
options = {"build_exe": build_exe_options},
executables = [Executable("client_test.py")])
편집 1 :가 나는 또한 zope.interface
에서 빈 __init__.py
파일을 퍼팅 시도한다는 얘기를 깜빡 했네요, 그 또한 도움이되지 않았다.
편집 2 :, 나 cx_Freeze를 사용하여 빌드 폴더의 library.zip 내부 zope.interface 거기에 내가 모듈 중 하나가 누락 생각하지 않는다,하지만 난 여전히 ImportError
Missing modules:
? _md5 imported from hashlib
? _sha imported from hashlib
? _sha256 imported from hashlib
? _sha512 imported from hashlib
? builtins imported from zope.schema._compat
? ctypes.macholib.dyld imported from ctypes.util
? dl imported from OpenSSL
? html imported from twisted.web.server
? netbios imported from uuid
? ordereddict imported from zope.schema._compat
? queue imported from twisted.internet.threads
? twisted.python._epoll imported from twisted.internet.epollreactor
? twisted.python._initgroups imported from twisted.python.util
? urllib.parse imported from twisted.web.server
? win32wnet imported from uuid
? wsaccel.utf8validator imported from autobahn.utf8validator
? zope.i18nmessageid imported from zope.schema._messageid
? zope.testing.cleanup imported from zope.schema.vocabulary
편집 : 3 : 여기합니다 (..
로 단축) 내 실행 파일에서 sys.path에 출력
이 나 cx_Freeze의 출력에서입니다 내가 직접 zope.interface
을 가져올 때 여기
['../build/exe.linux-x86_64-2.7/client_test',
'../build/exe.linux-x86_64-2.7',
'../build/exe.linux-x86_64-2.7/client_test.zip',
'../build/exe.linux-x86_64-2.7/library.zip']
는 내가 오류입니다 :
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
exec code in m.__dict__
File "client_test.py", line 3, in <module>
File "/usr/local/lib/python2.7/dist-packages/zope.schema-4.3.2-py2.7.egg/zope/__init__.py", line 1, in <module>
__import__('pkg_resources').declare_namespace(__name__)
ImportError: No module named pkg_resources
을 내 나 cx_Freeze의 setup.py에 포함되어 내에 pkg_resources
를 추가 한 후, 프로그램은 build_exe_options
A를 추가
''packages ':''zope.interface' ''를''build_exe_options'에 추가하면 어떨까요? –
이미 똑같은 오류가 발생했습니다. 나는 또한 그것을 동시에 'includes'와 'namespace_packages'에 추가했습니다. –
.egg 디렉토리에 설치되어 있습니까? cx_Freeze는 때때로 계란에서 물건을 찾는 데 어려움이 있습니다 (그러나 꼬인 것으로 보입니다). –