将软件包 (pywin32) 安装到 Python 嵌入式发行版

Installing packages (pywin32) to Python embedded distribution

Python 3.5 "embedded distribution" 是一个包含

的 ZIP 文件
pyexpat.pyd
python.exe
python3.dll
python35.dll
python35.zip
pythonw.exe
pyvenv.cfg
select.pyd
sqlite3.dll
unicodedata.pyd
vcruntime140.dll
winsound.pyd
_bz2.pyd
_ctypes.pyd
_decimal.pyd
_elementtree.pyd
_hashlib.pyd
_lzma.pyd
_msi.pyd
_multiprocessing.pyd
_overlapped.pyd
_socket.pyd
_sqlite3.pyd
_ssl.pyd

我需要安装pywin32

安装程序需要在系统上安装特定的 python 版本。无法手动提供目标路径。

安装包可以解压,但我对打包系统不熟悉,无法手动安装。

我发现 https://bootstrap.pypa.io/get-pip.py 设法获取 Scripts/pip.exe 并创建 Lib/site-packages.

但是:

tools\python
>pip install pywin32
  Could not find a version that satisfies the requirement pywin32 (from versions: )
No matching distribution found for pywin32

解决方案移至答案。

了解如何从当前安装程序手动安装软件包(或如何让安装程序使用指定路径)会很有趣。

https://pypi.python.org/pypi/pypiwin32

有一个(稍旧的)pywin32 版本作为 Python wheel
> pip.exe install pypiwin32
Collecting pypiwin32
  Downloading pypiwin32-219-cp35-none-win32.whl (7.9MB)
    100% |################################| 7.9MB 114kB/s
Installing collected packages: pypiwin32
Successfully installed pypiwin32-219

测试:

import win32clipboard

win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText( 'Hello World!', win32clipboard.CF_TEXT )
win32clipboard.CloseClipboard()

> python test.py

粘贴:Hello World!