Python PIP 找不到 pywin32(在 Windows 上)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40981120/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 00:16:47  来源:igfitidea点击:

Python PIP cannot find pywin32 (on windows)

pythonpython-3.xpip

提问by mike

I have installed python 3.5, and need to install pywin (pywin32)

我已经安装了python 3.5,需要安装pywin(pywin32)

however, pip cannot find it. Note, i have just PIP install'ed send2trash and gitpython successfully

但是,pip 找不到它。注意,我刚刚成功安装了 PIP 的 send2trash 和 gitpython

 Could not find a version that satisfies the requirement pywin32 (from versions: )

A few possibly relevant data points:

一些可能相关的数据点:

  • new install of python 3.5
  • windows 7 x64
  • python 2.7 was previously installed on the machine
  • as mentioned, several other packages were installed fine via PIP
  • running these commands from git-bash, which came from the git windows installer, installed some time ago. -- I have gnu grep in my path, so i believe i selected the git installer option to put the whole mysys toolchain in my path
  • 新安装的python 3.5
  • 视窗 7 x64
  • 之前机器上安装了python 2.7
  • 如前所述,其他几个软件包通过 PIP 安装得很好
  • 从 git-bash 运行这些命令,它来自 git windows 安装程序,前一段时间安装。-- 我的路径中有 gnu grep,所以我相信我选择了 git installer 选项将整个 mysys 工具链放在我的路径中

full --verbose output:

完整 --verbose 输出:

C:\Users\USER>pip install  pywin32    --proxy http://proxy.COMPANY.com:8080
Collecting pywin32
  Could not find a version that satisfies the requirement pywin32 (from versions: )
No matching distribution found for pywin32

C:\Users\USER>pip install  pywin32    --proxy http://proxy.COMPANY.com:8080 --verbose
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting pywin32
  1 location(s) to search for versions of pywin32:
  * https://pypi.python.org/simple/pywin32/
  Getting page https://pypi.python.org/simple/pywin32/
  Looking up "https://pypi.python.org/simple/pywin32/" in the cache
  Current age based on date: 61
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 61
  Analyzing links from page https://pypi.python.org/simple/pywin32/
  Could not find a version that satisfies the requirement pywin32 (from versions: )
Cleaning up...
No matching distribution found for pywin32
Exception information:
Traceback (most recent call last):
  File "c:\users\USER\appdata\local\programs\python\python35\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\USER\appdata\local\programs\python\python35\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\users\USER\appdata\local\programs\python\python35\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\users\USER\appdata\local\programs\python\python35\lib\site-packages\pip\req\req_set.py", line 554, in _prepare_file
    require_hashes
  File "c:\users\USER\appdata\local\programs\python\python35\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "c:\users\USER\appdata\local\programs\python\python35\lib\site-packages\pip\index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for pywin32 

采纳答案by Irmen de Jong

回答by kyle

I think you could use pip install pypiwin32instead.

我想你可以用pip install pypiwin32

回答by Himanshu Agarwal

If you are using a Python 3.5+ then you could add pypiwin32==223 to your requirements.txt file instead of pywin32

如果您使用的是 Python 3.5+,那么您可以将 pypiwin32==223 添加到您的 requirements.txt 文件而不是 pywin32

回答by jnnnnn

My problem was that pypiwin32 is only supported on Python 3.5+.

我的问题是 pypiwin32 仅在 Python 3.5+ 上受支持。

回答by vinayak hegde

If anyone still looking for pywin32 for python34, here is the link. Download and install. This resolves the issue https://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/

如果有人仍在寻找 python34 的 pywin32,这里是链接。下载并安装。这解决了这个问题 https://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/

回答by alpha_989

The pypi index mentions that pywin32 is not supported for python 3.5, only till python 3.3. https://pypi.python.org/pypi/pywin32. Which is why you are getting the error.

pypi 索引提到 python 3.5 不支持 pywin32,直到 python 3.3。https://pypi.python.org/pypi/pywin32。这就是您收到错误的原因。

However, you can install it from here as a binary package. It should work. I have used xlwings with pyton 3.6.2, which requires pywin32. Pywin32 build 220, works fine atleast for the functions I needed.

但是,您可以从此处将其作为二进制包安装。它应该工作。我已经将 xlwings 与 pyton 3.6.2 一起使用,它需要 pywin32。Pywin32 build 220,至少对于我需要的功能来说效果很好。