1

I want to use the library win32com on Python version 3.7.4 but I don't have administrator rights (only user admin rights I believe).

I also have the version 2.7.15 installed (which I can't uninstall) from when I did had admin rights and tried Python for my first time. That is the version that shows when I run the command python --version on the cmd console, so if I try to run the command python -m pip install pywin32 it does install but on that version and throws a warning that it will be deprecated January 1st, 2020.

So I'm trying to do it manually by following these instructions. I downloaded pywin32-225-cp37-cp37m-win32.whl (8.4 MB), unzipped to a folder and now I'm not sure what to do.

The Python folder is at:

%UserProfile%\AppData\Local\Programs\Python\Python37-32

user7393973
  • 2,270
  • 1
  • 20
  • 58
  • `pip install pywin32-225-cp37-cp37m-win32.whl` should do – Saharsh Oct 03 '19 at 11:08
  • @Saharsh on cmd pip is not recognized as a command and trying `python -m pip install pywin32-225-cp37-cp37m-win32.whl` installs it on Python version 2.7 – user7393973 Oct 03 '19 at 11:13
  • that's probably because you have both Python2 and Python3 installed. Try pinning the location of `Python3.exe` and execute the command that @CristiFati have mentioned – Saharsh Oct 03 '19 at 11:15

1 Answers1

1

Install the package in the user directory, by passing --user:

"${FULL_PATH_TO_YOUR_PYTHON37_EXECUTABLE}" -m pip install --user pywin32

where ${FULL_PATH_TO_YOUR_PYTHON37_EXECUTABLE} is just a placeholder (in your case it seems to be C:\Users\MyUserName\AppData\Local\Programs\Python\Python37-32\python.exe).

More details on [PyPA.PIP]: pip install (pip install -h).

Note: This is a duplicate of [SO]: How to install a package for specific version on python on windows 10? (@CristiFati's answer), but since that question has neither an accepted nor an upvoted answer, I can't mark this one as such.

CristiFati
  • 38,250
  • 9
  • 50
  • 87
  • Running that command installs it on Python 2.7, I want to install on 3.7 – user7393973 Oct 03 '19 at 11:11
  • I tried `${"C:\Users\MyUserName\AppData\Local\Programs\Python\Python37-32"}\python -m pip install --user pywin32` but it says that the syntax name of the directory is incorrect. I also tried with \\ and / instead of \. – user7393973 Oct 03 '19 at 11:21
  • :) Edited again (I wasn't clear enough, that's just a placeholder). – CristiFati Oct 03 '19 at 11:27
  • Thanks. It worked with `"C:\Users\MyUserName\AppData\Local\Programs\Python\Python37-32\python.exe" -m pip install --user pywin32`. – user7393973 Oct 03 '19 at 11:35