如何在 Python 3.4 或 Python 2.7 上安装 win32com.client
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48012356/
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
How to install win32com.client on Python 3.4 or Python 2.7
提问by Jen
I tried to install win32com.client using the syntax below, but no success
我尝试使用以下语法安装 win32com.client,但没有成功
>>> pip install pywin32
SyntaxError: invalid syntax
语法错误:无效语法
>>> pypiwin32
Traceback (most recent call last): File "", line 1, in pypiwin32 NameError: name 'pypiwin32' is not defined
回溯(最近一次调用最后一次):文件“”,第 1 行,在 pypiwin32 中 NameError:未定义名称“pypiwin32”
>>> pip install pypiwin32
SyntaxError: invalid syntax
语法错误:无效语法
>>> pip install pypiwin32-220-cp36-none-win32.whl
SyntaxError: invalid syntax
语法错误:无效语法
回答by pylang
Those errors suggest you are inside a Python environment. For example, the Python REPL starts with three chevrons, >>>
. You don't want this. Run these commands outside of Python in the system command prompt either through Windowsor Linuxetc.
这些错误表明您在 Python 环境中。例如,Python REPL 以三个 V 形开始,>>>
. 你不想要这个。在系统命令提示符下通过Windows或Linux等在 Python 之外运行这些命令 。
The following worked for me on Python 2.7:
以下在 Python 2.7 上对我有用:
> pip install pypiwin32
Also try the following from this post:
还可以从这篇文章中尝试以下操作:
> python -m pip install pypiwin32
回答by Maruf
first command work for me somehow.........
第一个命令以某种方式为我工作.........
C:\Users\AL MARUF>pip install pypiwin32 Collecting pypiwin32 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pypiwin32/ Downloading https://files.pythonhosted.org/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whlCollecting pywin32>=223 (from pypiwin32) Downloading https://files.pythonhosted.org/packages/8a/37/917c4020e93e0e854d4cbff1cbdf14ec45a6d1cedf52f8cafdea5b22451a/pywin32-224-cp37-cp37m-win32.whl(8.3MB) |████████████████████████████████| 8.3MB 142kB/s Installing collected packages: pywin32, pypiwin32 Successfully installed pypiwin32-223 pywin32-224
C:\Users\AL MARUF>pip install pypiwin32 收集 pypiwin32 警告:在连接被“NewConnectionError(': Failed建立一个新的连接:[Errno 11001] getaddrinfo failed')': /simple/pypiwin32/ 下载https://files.pythonhosted.org/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a65a92323pya65ac42323pya65ac423223pya65ac423203-py whl收集 pywin32>=223(来自 pypiwin32) 下载https://files.pythonhosted.org/packages/8a/37/917c4020e93e0e854d4cbff1cbdf14ec45a6d1cedf52f8cafdea5b22win42323-cpw3-cpw3-cpw3-c(8.3MB) |████████████████████████████████| 8.3MB 142kB/s 安装收集包:pywin32, pypiwin32 成功安装 pypiwin32-223 pywin32-224