我已经下载了Python2.7.3,PyInstaller (兼容2.7)和pywin32 (兼容2.7),并重新启动了我的机器,但当我输入提示时:
pyinstaller.py选择nameofscript.py
然后提示符告诉我:
错误: windows上Python 2.6+的PyInstaller需要pywin32。请从http://sourceforge.net/projects/pywin32/安装
为什么我已经下载了pywin32,PyInstaller却看不到?
发布于 2018-12-06 04:01:48
如果您使用的是Python2.7,则需要将C:/Python27/Lib/site-packages/PyInstaller文件中的compat.py更改为:
if is_win:
try:
#from win32ctypes.pywin32 import pywintypes # noqa: F401
#from win32ctypes.pywin32 import win32api
import pywintypes
import win32api
except ImportError:
# This environment variable is set by seutp.py
# - It's not an error for pywin32 to not be installed at that point
if not os.environ.get('PYINSTALLER_NO_PYWIN32_FAILURE'):
raise SystemExit('PyInstaller cannot check for assembly dependencies.\n'
'Please install PyWin32 or pywin32-ctypes.\n\n'
'pip install pypiwin32\n')才能工作。
发布于 2013-04-27 01:33:00
明白了!我找到了这个有用的教程:
http://bojan-komazec.blogspot.ca/2011/08/how-to-create-windows-executable-from.html
第三段告诉你如何解决这个问题。然而,他指出的联系是棘手的。您需要转到此处获取pywin32安装程序。
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/
发布于 2014-11-07 09:04:28
您应该首先将pywin32安装到Python路径,然后通过运行以下Python命令验证它是否成功:
import win32com如果没有错误,则安装pywin32。
https://stackoverflow.com/questions/14718414
复制相似问题