鱼C论坛

 找回密码
 立即注册
查看: 780|回复: 1

关于pyinstaller的问题

[复制链接]
发表于 2020-3-7 18:18:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
各位大佬,我想实现通过pyinstaller把python文件打包成为exe,在pyinstaller使用中出现了这些问题
pip show pyinstaller
Name: PyInstaller
Version: 3.6
Summary: PyInstaller bundles a Python application and all its dependencies into a single package.
Home-page: http://www.pyinstaller.org
Author: Giovanni Bajo, Hartmut Goebel, David Vierra, David Cortesi, Martin Zibricky
Author-email: pyinstaller@googlegroups.com
License: GPL license with a special exception which allows to use PyInstaller to build and distribute non-free programs (including commercial ones)
Location: c:\users\liuyibin\anaconda3\lib\site-packages
Requires: pywin32-ctypes, setuptools, altgraph, pefile
Required-by:


pyinstaller是安装成功的,然后就会出错
pyinstaller -F 00.py
Traceback (most recent call last):
  File "c:\users\liuyibin\anaconda3\lib\site-packages\cffi\cparser.py", line 132, in _parse
    ast = _get_parser().parse(csource)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\pycparser\c_parser.py", line 146, in parse
    debug=debuglevel)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\pycparser\ply\yacc.py", line 265, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\pycparser\ply\yacc.py", line 1047, in parseopt_notrack
    tok = self.errorfunc(errtoken)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\pycparser\c_parser.py", line 1680, in p_error
    column=self.clex.find_tok_column(p)))
  File "c:\users\liuyibin\anaconda3\lib\site-packages\pycparser\plyparser.py", line 55, in _parse_error
    raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: :16:16: before: LoadLibraryExW

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\liuyibin\anaconda3\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\liuyibin\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\liuyibin\Anaconda3\Scripts\pyinstaller.exe\__main__.py", line 4, in <module>
  File "c:\users\liuyibin\anaconda3\lib\site-packages\PyInstaller\__init__.py", line 18, in <module>
    from . import compat
  File "c:\users\liuyibin\anaconda3\lib\site-packages\PyInstaller\compat.py", line 251, in <module>
    from win32ctypes.pywin32 import pywintypes  # noqa: F401
  File "c:\users\liuyibin\anaconda3\lib\site-packages\win32ctypes\pywin32\__init__.py", line 11, in <module>
    from win32ctypes.pywin32 import win32api
  File "c:\users\liuyibin\anaconda3\lib\site-packages\win32ctypes\pywin32\win32api.py", line 12, in <module>
    from win32ctypes.core import (
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "c:\users\liuyibin\anaconda3\lib\site-packages\win32ctypes\core\__init__.py", line 36, in load_module
    module = importlib.import_module(self.redirect_module)
  File "c:\users\liuyibin\anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\win32ctypes\core\cffi\_dll.py", line 19, in <module>
    """)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\cffi\api.py", line 107, in cdef
    self._parser.parse(csource, override=override, packed=packed)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\cffi\cparser.py", line 171, in parse
    self._internal_parse(csource)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\cffi\cparser.py", line 177, in _internal_parse
    ast, macros, csource = self._parse(csource)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\cffi\cparser.py", line 134, in _parse
    self.convert_pycparser_error(e, csource)
  File "c:\users\liuyibin\anaconda3\lib\site-packages\cffi\cparser.py", line 163, in convert_pycparser_error
    raise api.CDefError(msg)
cffi.api.CDefError: cannot parse "HMODULE WINAPI LoadLibraryExW(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags);"
:16:16: before: LoadLibraryExW
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-3-8 20:50:27 | 显示全部楼层
你把原来的卸了再装一个试试
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-25 04:22

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表