Ofir
Ofir

Reputation: 47

python winapi installation on 3.65

I need to use winapi for a project and I must use python 3.6 to do so.

I have two interpreters installed: python 3.65 and python 2.7 (the original). Whenever I use the pip install pypiwin32 command it tells me it is already installed on the 2.7 version. When I tried to move the files from the 2.7 directory to the 3.65 directory it wouldn't work.

How do I install winapi on python 3.65?

Upvotes: 0

Views: 122

Answers (2)

abarnert
abarnert

Reputation: 366013

When you have multiple Pythons installed, and you don’t want to use virtual environments, the best solution is to run pip this way:

$ python3 -m pip install spam

Or, on Windows, using the py launcher:

C:\> py -3 -m pip install spam

Or, if you normally run Python 3.6 with some totally different command, same thing:

$ /opt/local/python36/bin/python -m pip install spam

As long as you know how to run the Python version you want to run, you can run it with -m pip, and that way you can be sure you’re getting the pip that goes with that Python version, and installing packages into that Python version’s site library.

All that being said, is there a reason you don’t want to use virtual environments? It would make your life a lot easier in this case.

Upvotes: 2

Ralf
Ralf

Reputation: 16515

When there are both versions of python installed (2.x and 3.x), the command pip3 should be available to target the newer version.

You could try

pip3 install pypiwin32

Let us know how it goes.

Upvotes: 0

Related Questions