Exception has occurred: ModuleNotFoundError No module named 'win32api'
This is because the vscode search module using the workspace as the root directory to search, rather than the current file.
You need to add the relative path or absolute path of the file to be imported at the beginning of the file.
import sys
sys.path.append("your path of module")
Python 3.4 :ImportError: no module named win32api
Try to install pywin32 from here :
http://sourceforge.net/projects/pywin32/files/pywin32/
depends on you operation system and the python version that you are using. Normally 32bit version should works on both 32 and 64 bit OS.
EDIT: moved to https://github.com/mhammond/pywin32/releases
No module named 'win32api'
The installation for pywin32 must have failed, or it is not for same OS bit architecture (say anaconda 64 bit and pywin32 32 bit). I recommend
- you uninstall pywin32,
- check what bit version of anaconda you are using, then
- install pywin32 for same version,
- verify that the installer indicates 100% success and there are no errors flagged in the installer's log window (it's rare but something may fail and the installer doesn't know).
- Then open a python console and type "import win32com".
If #5 fails to import win32com, then:
- try installing a different version of python, for example from python.org
- repeat steps 2 to 5 above but for new python instead of anaconda
Could be that anaconda distributors did something to the python interpreter (although I didn't think so), or that some libs aren't registered right (see answer https://stackoverflow.com/a/17061853/869951 for some more things to try).
Related Topics
Interact with Other Programs Using Python
Timedelta to String Type in Pandas Dataframe
Get Files Names Inside a Zip File on Ftp Server Without Downloading Whole Archive
Cx_Freeze Crashing Python 3.7.0
How to Normalize JSON Correctly by Python Pandas
When to Use Sys.Path.Append and When Modifying %Pythonpath% Is Enough
How to Read One Single Line of CSV Data in Python
How to Convert an Iterable to a Stream
Django Template System, Calling a Function Inside a Model
Differencebetween Join and Merge in Pandas
How to Use a String as a Keyword Argument
Printing a List Separated with Commas, Without a Trailing Comma
How to Make the Width of the Title Box Span the Entire Plot
How to Check If an Object Is a List or Tuple (But Not String)
Keep a Subprocess Alive and Keep Giving It Commands? Python