导入错误:没有名为 pythoncom 的模块
我是这个 Python 世界的新手(才 1 周)。我尝试安装 django-mssql,但是当我尝试导入库(使用 import sqlserver_ado.dbapi)时,我收到此错误消息:
ImportError: No module named pythoncom
我尝试查找该库但没有成功。
你们能指出我正确的方向吗?
I am a newbie (just 1 week) to this Python world. I tried installing django-mssql, but when I tried to import the library (using import sqlserver_ado.dbapi
), I got this error message:
ImportError: No module named pythoncom
I tried to look for that library without success.
Can you guys point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您缺少
pythoncom
包。它附带 ActivePython 但您可以在 GitHub (之前位于 SourceForge )作为 pywin32 的一部分。您还可以简单地使用:
You are missing the
pythoncom
package. It comes with ActivePython but you can get it separately on GitHub (previously on SourceForge) as part of pywin32.You can also simply use:
如果您使用的是 Windows,您可能需要
pywin32
库,其中包括pythoncom
和许多其他非常标准的东西。If you're on windows you probably want the
pywin32
library, which includespythoncom
and a whole lot of other stuff that is pretty standard.您应该使用
pip
来安装软件包,因为它可以让您卸载能力。另外,请查看
virtualenv
。它与pip
配合得很好,并为您提供了一个沙箱,这样您就可以探索新的东西,而不会意外地托管您的系统范围的安装。You should be using
pip
to install packages, since it gives you uninstall capabilities.Also, look into
virtualenv
. It works well withpip
and gives you a sandbox so you can explore new stuff without accidentally hosing your system-wide install.有时,如果仅
pip
本身不起作用,则使用pip3
也可以。Sometimes using
pip3
also works if justpip
by itself is not working.只需进入 cmd 并安装
pip install pywin32
pythoncom 是 pywin32 的一部分,用于 API 窗口扩展....Just go to cmd and install
pip install pywin32
pythoncom is part of pywin32 for API window extension....