简体   繁体   English

PyInstaller-ImportError:没有名为win32api的模块

[英]PyInstaller - ImportError: No module named win32api

I'm trying to compile a Python project (using Python 2.7 on Windows XP) into an EXE using PyInstaller with the default options. 我正在尝试使用带有默认选项的PyInstaller将Python项目(在Windows XP上使用Python 2.7)编译为EXE。 When I try to run the EXE, I get the message: 当我尝试运行EXE时,出现以下消息:

PyInstaller - ImportError: No module named win32api PyInstaller-ImportError:没有名为win32api的模块

I added the win32api path to the windows PATH environment variable (I do have Python Win32 Extensions installed) but it's not working. 我在Windows PATH环境变量中添加了win32api路径(我确实安装了Python Win32 Extensions),但是它不起作用。 I'm pretty new to this and a little overwhelmed by all the options etc, and I really have no idea where to start (or what information would be useful to solving this problem.) I assume this is some little thing that I'm missing, but I haven't found anyone having precisely this problem online and any help would be greatly appreciated. 我对此很陌生,并且对所有选项等都有些不知所措,而且我真的不知道从哪里开始(或者什么信息将对解决这个问题有用。)我认为这是我的一些小事情丢失了,但我还没有找到任何人在网上确切地遇到此问题,因此不胜感激。

Ok, it looks like "import os" in one of my modules was causing this issue. 好的,似乎我的一个模块中的“ import os”导致了此问题。 I had no luck getting it to successfully use the win32api module, but since this was only being used to set the program name, I just commented this out and this particular issue is resolved. 我没有让它成功使用win32api模块的运气,但是由于这只是用来设置程序名称,因此我将其注释掉,并且解决了该特定问题。 Thanks Luke for your help! 感谢卢克的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM