Search code examples
packagepython-3.5pywin32

Installing packages (pywin32) to Python embedded distribution


The Python 3.5 "embedded distribution" is a ZIP file containing

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

I need to install pywin32

The installer requires the specific python version to be installed on the system. Target paths cannot be provided manually.

Dialog

Selection

The installer can be unzipped but I am not familiar with the packaging system, so I cannot do a manual install.

I found https://bootstrap.pypa.io/get-pip.py which manages to get Scripts/pip.exe and creates Lib/site-packages.

But:

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

Solution moved to answer.

It would be interesting to know how manually install the package from the the current installer (or how to get the installer to use a specified path).


Solution

  • There is a (slightly older) release of pywin32 as Python wheel at https://pypi.python.org/pypi/pypiwin32

    > 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
    

    Test:

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

    > python test.py

    Paste: Hello World!