Jen
Jen

Reputation: 153

How to install win32com.client on Python 3.4 or Python 2.7

I tried to install win32com.client using the syntax below, but no success

>>> pip install pywin32

SyntaxError: invalid syntax

>>> pypiwin32

Traceback (most recent call last): File "", line 1, in pypiwin32 NameError: name 'pypiwin32' is not defined

>>> pip install pypiwin32

SyntaxError: invalid syntax

>>> pip install pypiwin32-220-cp36-none-win32.whl

SyntaxError: invalid syntax

Upvotes: 11

Views: 112332

Answers (3)

RITA KUSHWAHA
RITA KUSHWAHA

Reputation: 496

Install the package via command prompt or Terminal of your python IDE(ex: PyCharm)

pip install pywin32

Upvotes: 5

Maruf
Maruf

Reputation: 11

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('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x032A8C70>: 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.whl
Collecting 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

Upvotes: 0

pylang
pylang

Reputation: 44475

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

Upvotes: 11

Related Questions