免费注册 查看新帖 |

ChinaUnix.net

  平台 论坛 博客 文库 频道自动化运维 虚拟化 储存备份 C/C++ PHP MySQL 嵌入式 Linux系统
最近访问板块 发新帖
查看: 2988 | 回复: 0

pyinstall打包编译exe import Crypto.Cipher报错 [复制链接]

论坛徽章:
0
发表于 2018-03-07 16:02 |显示全部楼层
5可用积分
测试只要导入pycrypto里面的这个编译之后就报错。程系在未编译的时候正常运行。

编译报错日志:
missing module named 'win32com.gen_py' - imported by win32com, C:\Python36\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_win32comgenpy.py
missing module named pyimod03_importers - imported by C:\Python36\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py
missing module named StringIO - imported by pkg_resources._vendor.six
missing module named __builtin__ - imported by pkg_resources._vendor.pyparsing
missing module named ordereddict - imported by pkg_resources._vendor.pyparsing
missing module named 'pkg_resources.extern.pyparsing' - imported by pkg_resources._vendor.packaging.markers, pkg_resources._vendor.packaging.requirements
missing module named 'com.sun' - imported by pkg_resources._vendor.appdirs
missing module named com - imported by pkg_resources._vendor.appdirs
missing module named __main__ - imported by pkg_resources
missing module named multiprocessing.SimpleQueue - imported by multiprocessing, concurrent.futures.process
missing module named multiprocessing.set_start_method - imported by multiprocessing, multiprocessing.spawn
missing module named multiprocessing.get_start_method - imported by multiprocessing, multiprocessing.spawn
missing module named multiprocessing.TimeoutError - imported by multiprocessing, multiprocessing.pool
missing module named multiprocessing.get_context - imported by multiprocessing, multiprocessing.pool, multiprocessing.managers, multiprocessing.sharedctypes
missing module named multiprocessing.BufferTooShort - imported by multiprocessing, multiprocessing.connection
missing module named multiprocessing.AuthenticationError - imported by multiprocessing, multiprocessing.connection
missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern, pkg_resources, setuptools.dist, setuptools.command.egg_info
missing module named pkg_resources.extern.appdirs - imported by pkg_resources.extern, pkg_resources
missing module named 'pkg_resources.extern.six.moves' - imported by pkg_resources, pkg_resources._vendor.packaging.requirements
missing module named pkg_resources.extern.six - imported by pkg_resources.extern, pkg_resources
missing module named 'multiprocessing.forking' - imported by C:\Python36\lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_multiprocessing.py
missing module named resource - imported by posix, Z:\drewself\python\test.py
missing module named posix - imported by os, Z:\drewself\python\test.py
missing module named _posixsubprocess - imported by subprocess, multiprocessing.util, Z:\drewself\python\test.py
missing module named org - imported by pickle, Z:\drewself\python\test.py
missing module named readline - imported by cmd, code, pdb, Z:\drewself\python\test.py
excluded module named _frozen_importlib - imported by importlib, importlib.abc, Z:\drewself\python\test.py
missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, Z:\drewself\python\test.py
missing module named _winreg - imported by platform, Z:\drewself\python\test.py, pkg_resources._vendor.appdirs
missing module named _scproxy - imported by urllib.request
missing module named java - imported by platform, Z:\drewself\python\test.py
missing module named 'java.lang' - imported by platform, Z:\drewself\python\test.py, xml.sax._exceptions
missing module named vms_lib - imported by platform, Z:\drewself\python\test.py
missing module named termios - imported by tty, Z:\drewself\python\test.py, getpass
missing module named urllib.splittag - imported by urllib, setuptools.py26compat
missing module named grp - imported by shutil, tarfile, distutils.archive_util, Z:\drewself\python\test.py
missing module named pwd - imported by posixpath, shutil, tarfile, http.server, webbrowser, distutils.util, distutils.archive_util, Z:\drewself\python\test.py, netrc, getpass
missing module named _dummy_threading - imported by dummy_threading, Z:\drewself\python\test.py
missing module named 'org.python' - imported by copy, setuptools.sandbox, Z:\drewself\python\test.py, xml.sax
missing module named testing - imported by cffi.recompiler
missing module named dummy_thread - imported by cffi.lock
missing module named thread - imported by cffi.lock, cffi.cparser
missing module named numpy - imported by setuptools.msvc
missing module named 'setuptools.extern.six.moves' - imported by setuptools.dist, setuptools.command.easy_install, setuptools.sandbox, setuptools.command.setopt, setuptools.package_index, setuptools.ssl_support, setuptools.command.egg_info, setuptools.command.py36compat, setuptools.msvc
missing module named 'pkg_resources.extern.packaging.version' - imported by setuptools.msvc
missing module named setuptools.extern.six - imported by setuptools.extern, setuptools.monkey, setuptools.dist, setuptools.depends, setuptools.command.easy_install, setuptools.sandbox, setuptools.package_index, setuptools.command.bdist_egg, setuptools.command.egg_info, setuptools.command.sdist, setuptools.unicode_utils, setuptools.glob
missing module named setuptools_svn - imported by setuptools.command.egg_info
missing module named urllib2 - imported by setuptools.package_index
missing module named wincertstore - imported by setuptools.ssl_support
missing module named 'backports.ssl_match_hostname' - imported by setuptools.ssl_support
missing module named backports - imported by setuptools.ssl_support
missing module named 'setuptools.extern.six' - imported by setuptools, setuptools.extension
missing module named cStringIO - imported by cPickle, cffi.ffiplatform
missing module named copy_reg - imported by cPickle, cStringIO
missing module named cPickle - imported by pycparser.ply.yacc
missing module named cffi._pycparser - imported by cffi, cffi.cparser
missing module named md5 - imported by Crypto.Hash.MD5
missing module named sha - imported by Crypto.Hash.SHA1


编译后exe文件运行报错:
Z:\drewself\python\dist>test.exe
Traceback (most recent call last):
  File "test.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "C:\Python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "Crypto\Cipher\__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "C:\Python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "Crypto\Cipher\_mode_ecb.py", line 46, in <module>
  File "Crypto\Util\_raw_api.py", line 191, in load_pycryptodome_raw_lib
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cp36-win_amd64.pyd': cannot load library C:\Users\ADMINI~1\AppData\Local\Temp\_MEI150642\Crypto\Util\..\Cipher\_raw_ecb.cp36-win_amd64.pyd: error 0x7e.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI150642\\Crypto\\Util\\..\\Cipher\\_raw_ecb.cp36-win_amd64.pyd', Trying '_raw_ecb.pyd': cannot load library C:\Users\ADMINI~1\AppData\Local\Temp\_MEI150642\Crypto\Util\..\Cipher\_raw_ecb.pyd: error 0x7e.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI150642\\Crypto\\Util\\..\\Cipher\\_raw_ecb.pyd'
[10184] Failed to execute script test

测试重新安装pycrypto还是不行。
测试只要不导入import Crypto.Cipher就没有任何问题?求助各位大神遇到过类似问题没有?

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

数据风云,十年变迁
DTCC 第十届中国数据库技术大会已启航!

2019年5月8日~5月10日,由IT168旗下ITPUB企业社区平台主办的第十届中国数据库技术大会(DTCC2019),将在北京隆重召开。大会将邀请百余位行业专家,就热点技术话题进行分享,是广大数据领域从业人士的又一次年度盛会和交流平台。与SACC2018类似,本届大会将采用“3+2”模式:3天传统技术演讲+2天深度主题培训。大会不仅提供超100场的主题演讲,还会提供连续2天的深度课程培训,深化数据领域的项目落地实践方案。
DTCC2019,一场值得期待的数据技术盛会,殷切地希望您报名参与!

活动入口>>
  

北京盛拓优讯信息技术有限公司. 版权所有 16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122
中国互联网协会会员  联系我们:huangweiwei@it168.com
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP