1

I have a python script which is refused to run:

py C:\Users\tester\move.py
Traceback (most recent call last):
  File "C:\Users\tester\Desktop\moveMousePeriodicallyAdmin2.py", line 9, in <module>
    import win32api, win32con
ImportError: DLL load failed: The specified module could not be found.

I saw couple of solutions from various old thread however none of them fix the issue.

  1. pip show pywin32 no result is returned at terminal

  2. Scripts\pywin32_postinstall.py -install

and result is not good:

c:\Programme\Python35\Scripts>pywin32_postinstall.py -install
Traceback (most recent call last):
  File "C:\Programme\Python35\Scripts\pywin32_postinstall.py", line 613, in <module>
    install()
  File "C:\Programme\Python35\Scripts\pywin32_postinstall.py", line 321, in install
    LoadSystemModule(lib_dir, "pywintypes")
  File "C:\Programme\Python35\Scripts\pywin32_postinstall.py", line 159, in LoadSystemModule
    mod = imp.load_dynamic(modname, filename)
  File "C:\Programme\Python35\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 577, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 914, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
user2201789
  • 1,083
  • 2
  • 20
  • 45
  • What's your *PyWin32* version? How did you install it? Try uninstall / install: `"C:\Programme\Python35\python.exe" -m pip uninstall pywin32` then `"C:\Programme\Python35\python.exe" -m pip install pywin32`. – CristiFati Oct 06 '22 at 15:13
  • not sure if this is network issue, I can surf internet. however install not proceed. c:\Programme\Python35\Scripts>"C:\Programme\Python35\python.exe" -m pip install pywin32 Collecting pywin32 Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pywin32/ – user2201789 Oct 07 '22 at 05:18
  • Try downloading https://files.pythonhosted.org/packages/68/ce/598fa78c2f475dfd7d24fc66e608ab2579d03a696ed6d1a3cb2cb96ad4b7/pywin32-301-cp35-cp35m-win32.whl, and install it locally. Check [\[SO\]: Installing pygraphviz on Windows 10 64-bit, Python 3.6 (@CristiFati's answer)](https://stackoverflow.com/a/54890705/4788546) (*Shortcut* section at the end) for details regarding custom *.whl* installation. – CristiFati Oct 07 '22 at 05:26
  • @CristiFati pywin32-301-cp35-cp35m-win32.whl is not a supported wheel on this platform. – user2201789 Oct 10 '22 at 03:02
  • I did this and the component installed, but what is this component for? is it replace the pywin32? "C:\Programme\Python35\python.exe" -m pip install C:\Users\tester\Downloads\pygraphviz-1.5-cp35-cp35m-win_amd64.whl Processing c:\users\8aso_build\downloads\pygraphviz-1.5-cp35-cp35m-win_amd64.whl Installing collected packages: pygraphviz Successfully installed pygraphviz-1.5 – user2201789 Oct 10 '22 at 03:08
  • I'm sorry, I didn't provide enough details. *PyGrapviz* is not required at all in this case, it has nothing to do here, but I was giving it as an example, to do the same for *PyWin32*. So the *.whl* that I indicated does not work, let's try the *064bit* version: https://files.pythonhosted.org/packages/72/77/b02f15f1a488c015f9d41dda1c83d97af8dc9c98f8dab5d4894fd01c4ee4/pywin32-300-cp35-cp35m-win_amd64.whl. – CristiFati Oct 10 '22 at 08:04
  • @CristiFati it is same still. Not supported. – user2201789 Oct 10 '22 at 12:25
  • What *Python* do you have? How did you install it? `"C:\Programme\Python35\python.exe" -c "import sys;print(sys.version_info, sys.platform, sys.maxsize)"` What's the command that you used, when installing the 2 *.whl*s that failed? – CristiFati Oct 10 '22 at 13:10
  • i resolved the network issue, "C:\Programme\Python35\python.exe" -m pip install pywin32 installed properly then, pywin32_postinstall.py -install also success. issue resolved. – user2201789 Oct 11 '22 at 01:50

1 Answers1

0

I resolved the network issue, "C:\Programme\Python35\python.exe" -m pip install pywin32 installed properly

Then pywin32_postinstall.py -install also success. issue resolved.

user2201789
  • 1,083
  • 2
  • 20
  • 45