Python Forum

Full Version: how do i fix “No module named win32api” on python2.7 ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
this is not coding but i really need help and couldn't find the right forum..

Hello, I am trying to import win32api in python 2.7.9. i did the "pip install pypiwin32" and made sure all the files were intalled correctly (i have the win32api.pyd under ${PYTHON_HOME}\Lib\site-packages\win32). i also tried coping the files from C:\Python27\Lib\site-packages\pywin32_system32 to C:\Python27\Lib\site-packages\win32. I also tried restarting my pc after each of these steps but nothing seems to work! i still get the error 'No module named 'win32api'. these 3 things were the only suggestions i could find on the internet and it seemed to work for others so i think the problem might be with my windows.
Also, i have no idea in which forum to post this so pleas move it to the right forum.
thanks in advance,
-shon
As you should not be using Python 2 anymore,then this could be a time to upgrade,then it will also work.
Python 3.6/3.7 and pip installation under Windows
After this pip install pypiwin32
Just to show that it work,i use virtual environment as i already has it installed.
(test_env) C:\1\test_env>pip install pypiwin32
Collecting pypiwin32
......  
Installing collected packages: pywin32, pypiwin32
Successfully installed pypiwin32-223 pywin32-224

# Version i use
(test_env) C:\1\test_env>python -V
Python 3.7.3

# Running from
(test_env) C:\1\test_env>python -c "import sys; print(sys.executable)"
C:\1\test_env\Scripts\python.exe

(test_env) C:\1\test_env>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
>>> # No error
>>> exit()