Start a command line with admin rights.
python -m pip install pywin32C:\Program Files\Stackless36\Scripts>python pywin32_postinstall.py -installThe pathC:\Program Files\Stackless36\should be replaced with the path at which your Python version is installed.Test (admin rights optional) using
python -c "import win32com"orpython speak.pywhere
speak.pyconsists of this text:import win32com.client speaker = win32com.client.Dispatch("SAPI.SpVoice") speaker.Speak("It works. Hoorah!")
Working fine on Python 3.6.4 Stackless 3.1b3 060516 (v3.6.4-slp:9557b2e530, Dec 21 2017, 15:23:10) [MSC v.1900 64 bit (AMD64)] on win32. Vanilla CPython hangs out here:
C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32com'
>>> exit()
C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe -m pip install pywin32
Collecting pywin32
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/d4/2d/b927e61c4a2b0aaaab72c8cb97cf748c319c399d804293164b0c43380d5f/pywin32-223-cp36-cp36m-win32.whl (8.3MB)
100% |████████████████████████████████| 8.3MB 50kB/s
Installing collected packages: pywin32
Successfully installed pywin32-223
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Answer from Cees Timmerman on Stack ExchangeStart a command line with admin rights.
python -m pip install pywin32C:\Program Files\Stackless36\Scripts>python pywin32_postinstall.py -installThe pathC:\Program Files\Stackless36\should be replaced with the path at which your Python version is installed.Test (admin rights optional) using
python -c "import win32com"orpython speak.pywhere
speak.pyconsists of this text:import win32com.client speaker = win32com.client.Dispatch("SAPI.SpVoice") speaker.Speak("It works. Hoorah!")
Working fine on Python 3.6.4 Stackless 3.1b3 060516 (v3.6.4-slp:9557b2e530, Dec 21 2017, 15:23:10) [MSC v.1900 64 bit (AMD64)] on win32. Vanilla CPython hangs out here:
C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32com'
>>> exit()
C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe -m pip install pywin32
Collecting pywin32
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/d4/2d/b927e61c4a2b0aaaab72c8cb97cf748c319c399d804293164b0c43380d5f/pywin32-223-cp36-cp36m-win32.whl (8.3MB)
100% |████████████████████████████████| 8.3MB 50kB/s
Installing collected packages: pywin32
Successfully installed pywin32-223
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Check sys.path to make sure the directory where the module is installed is in there, otherwise you have to add it (google PYTHONPATH windows for some help with that.)
» pip install pywin32
how to install pywin32com.client (win32com) on PyPy?
python - How to install win32com module in a virtualenv? - Stack Overflow
python - ImportError: No module named win32com.client - Stack Overflow
python - Install win32com on MacOs and Linux - Stack Overflow
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 Windows or Linux etc.
The following worked for me on Python 2.7:
> pip install pypiwin32
Also try the following from this post:
> python -m pip install pypiwin32
Install the package via command prompt or Terminal of your python IDE(ex: PyCharm)
pip install pywin32
I seem to be able to install it using a normal python installation, but whenever I try any variaton of pypy -m pip install pypiwin32 it fails because one line of code somewhere is written with python 2 print syntax instead of python 3 print syntax.
File "C:\Users\UserName\AppData\Local\Temp\pip-install-s_f16dh8\pypiwin32_cbf43cf3d1b9474da7c0471119c544fe\setup.py", line 121
print "Building pywin32", pywin32_version
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
(Versions are Python 3.8.12 (9ef55f6fc369, Oct 24 2021, 20:12:27)
[PyPy 7.3.7 with MSC v.1929 64 bit (AMD64)] on win32)
UPDATE 2016
There is now a version of pywin32 on PyPI that can be installed with pip. It is called pypiwin32, and it installs the package using the binary wheel format.
https://pypi.python.org/pypi/pypiwin32
pip install pypiwin32
That will work in a virtualenv, or with tox, etc.
Below this line is my previous old answer. That is now outdated information.
OLD ANSWER - OUTDATED. Modern versions of virtualenv default to --no-site-packages. That means that not having access to global site-packages is now the default behavior. Sadly, (as of July 2014) you can not pip install pywin32 in to your virtualenv. (here's the bug report) If you want to get pywin32 running inside a virtualenv, activate the virtualenv and use easy_install and the pywin32 installer exe file. For example easy_install "C:\Path\To\Downloads\pywin32-219.win32-py3.4.exe"
Related question
Try this:
- Download directly
- Enable your virtualenv
pip install --no-index --find-links:/local/dir/ SomePackage
Check out #8 on pip-installer.org (sorry no permalink)/

