Python Forum
how do i fix “No module named win32api” on python2.7 ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i fix “No module named win32api” on python2.7 ?
#1
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
Reply
#2
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()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 821 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,562 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,488 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,409 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,476 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,308 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,016 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 8,826 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 990 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,815 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020