ImportError:没有系统模块' pywintypes' (pywintypes34.dll)

时间:2017-02-27 10:00:57

标签: python pyinstaller

我是一个Python新手,尝试将python脚本打包为exe。

我从here安装了pywin32,并从here下载了pyinstaller。

我有点关注this视频,当我尝试将文件打包到4:21时,我收到以下错误:

F:\Softs\PyInstaller-3.2.1\PyInstaller-3.2.1>python pyinstaller.py test.py --onefile
Traceback (most recent call last):
  File "pyinstaller.py", line 14, in <module>
    from PyInstaller.__main__ import run
  File "F:\Softs\PyInstaller-3.2.1\PyInstaller-3.2.1\PyInstaller\__main__.py", line 21, in <module>
    import PyInstaller.building.build_main
  File "F:\Softs\PyInstaller-3.2.1\PyInstaller-3.2.1\PyInstaller\building\build_main.py", line 32, in <module>
    from ..depend import bindepend
  File "F:\Softs\PyInstaller-3.2.1\PyInstaller-3.2.1\PyInstaller\depend\bindepend.py", line 38, in <module>
    from ..utils.win32.winmanifest import RT_MANIFEST
  File "F:\Softs\PyInstaller-3.2.1\PyInstaller-3.2.1\PyInstaller\utils\win32\winmanifest.py", line 97, in <module>
    from PyInstaller.utils.win32 import winresource
  File "F:\Softs\PyInstaller-3.2.1\PyInstaller-3.2.1\PyInstaller\utils\win32\winresource.py", line 20, in <module>
    import pywintypes
  File "C:\Python34\lib\site-packages\win32\lib\pywintypes.py", line 124, in <module>
    __import_pywin32_system_module__("pywintypes", globals())
  File "C:\Python34\lib\site-packages\win32\lib\pywintypes.py", line 98, in __import_pywin32_system_module__
    raise ImportError("No system module '%s' (%s)" % (modname, filename))
ImportError: No system module 'pywintypes' (pywintypes34.dll)

我查了一下错误,我只能找到 -

的解决方案
ImportError: No system module 'pywintypes' (pywintypes27.dll)

对我来说没有用。有人可以建议我哪里出错吗?提示会很好。

1 个答案:

答案 0 :(得分:1)

pywintypes38.dll 文件实际安装在文件夹路径中:

C:\Users\Asus\AppData\Roaming\Python\Python38\site-packages\pywin32_system32

The files present at the path

我将这些文件从这里复制到这个新路径:

C:\Users\Asus\AppData\Roaming\Python\Python38\site-packages\win32\lib

而且,它对我来说效果很好。