0

I installed pywin32 and pypiwin32 through pip and am able to confirm they are installed through cmd but am having problems importing win32com within PyCharm. My code very simply opens cmd as administrator thorugh the following code

import win32com.shell.shell as shell
commands = 'echo hi'
shell.ShellExecuteEx(lpVerb='runas', lpFile='cmd.exe', lpParameters='/c '+commands)

but I get the following error while trying to run the code:

ModuleNotFoundError: No module named 'win32com.shell'
  • Welcome to Stack Overflow. Probably [this post](https://stackoverflow.com/a/62635219) solves the problem. However I'm voting to close this question because you don't explicitly confirm if the interpreter that has the library is configured in PyCharm as your project interpreter and in case your are using it from the terminal if the venv was activated. – bad_coder Aug 14 '21 at 22:18

0 Answers0