导入错误:没有名为 pythoncom 的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4145079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ImportError: No module named pythoncom
提问by Quaspam
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:
我是这个 Python 世界的新手(仅 1 周)。我尝试安装 django-mssql,但是当我尝试导入库(使用import sqlserver_ado.dbapi)时,我收到以下错误消息:
ImportError: No module named pythoncom
I tried to look for that library without success.
我试图寻找那个图书馆没有成功。
Can you guys point me in the right direction?
你们能指出我正确的方向吗?
采纳答案by kichik
You are missing the pythoncompackage. It comes with ActivePythonbut you can get it separately on GitHub(previously on SourceForge) as part of pywin32.
您缺少pythoncom包裹。它随ActivePython 一起提供,但您可以在GitHub(以前在SourceForge 上)作为 pywin32 的一部分单独获取它。
You can also simply use:
您也可以简单地使用:
pip install pywin32
回答by Hank Gay
You should be using pipto install packages, since it gives you uninstall capabilities.
您应该pip用于安装软件包,因为它为您提供了卸载功能。
Also, look into virtualenv. It works well with pipand gives you a sandbox so you can explore new stuff without accidentally hosing your system-wide install.
另外,查看virtualenv. 它适用于pip并为您提供一个沙箱,因此您可以探索新内容而不会意外地在系统范围内安装。
回答by Binary Phile
If you're on windows you probably want the pywin32library, which includes pythoncomand a whole lot of other stuff that is pretty standard.
如果你在 Windows 上,你可能想要这个pywin32库,它包括pythoncom很多其他非常标准的东西。
回答by SSCSWAPNIL
pip3 install pypiwin32
pip3 安装 pypiwin32
$ pip3 install pypiwin32
$ pip3 安装 pypiwin32
Sometimes using pip3 also works if just pip is not working
有时,如果只是 pip 不起作用,则使用 pip3 也有效

