Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed: win32api, sys, os #23

Open
GoogleCodeExporter opened this issue Mar 19, 2015 · 14 comments
Open

ImportError: DLL load failed: win32api, sys, os #23

GoogleCodeExporter opened this issue Mar 19, 2015 · 14 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.Installed easy_install, set its path variable(C:\Python25\Scripts), installed 
the .egg by opening cmd from C:\Python25\Scripts, executing the command 
"easy_install speech-0.5.2-py2.5" (because that command didn't work from 
anywhere else, even after setting the PATH variable as mentioned above)
Tried "import speech" and got some win32com error.. I saw the instructions 
again, realised i didn't have pywin32.
And so i installed "pywin32-216.win32-py2.5.exe", just click click click.. done.

2. tried "import speech" on Python Shell. Worked. Arighty! *Le me happy*

3. Copied the first program on Project Home :
##################
import speech

while True:
    phrase = speech.input()
    speech.say("You said %s" % phrase)
    if phrase == "turn off":
        break
##################

and executed it, and got this:

###################################
Traceback (most recent call last):
  File "C:\Python25\speech\myPyListener.py", line 1, in <module>
    import speech
  File "C:\Python25\lib\site-packages\speech-0.5.2-py2.5.egg\speech.py", line 55, in <module>
  File "C:\Python25\Lib\site-packages\win32com\__init__.py", line 5, in <module>
    import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.
###################################

What version of the product are you using? On what operating system?

I'm using python python 2.5.4 (i also have python 2.7.2 but in your project 
page it said python 2.4 or 2.5 so i'm using 2.5)
My OS is Windows Vista Home Premium SP1 32 bit, with SR already installed. I 
mean i get that little rectangle asking me to "say start listening" etc when i 
have to execute SR, so i guess i don't need SAPI or any related download


Original issue reported on code.google.com by austinpa...@gmail.com on 19 Jan 2012 at 2:33

@GoogleCodeExporter
Copy link
Author

okay, just had a last moment doubt that i hadn't researched my problem well..

i found this:
http://code.activestate.com/lists/python-win32/10519/

and it seemed that win32*.pyd (which really are DLLs) could not be found, as 
according to that guy Frekin John

So i copied the 30 *.pyd files and placed them right next to 
C:\Python25\python.exe
and i tried the program again. It worked.

For all others out there just starting out:
30 files i copied constituted of 28 "win32*.pyd" name-form files, and remaining 
2 were "winxpgui.pyd" and "win2kras.pyd"

Happy programming!
BTW, authors of this wrapping, great work! This work of accessing the SAPI in C 
is really hectic (my friend is actually making a project on SR based action 
executor) and i wanted to show him he can drastically reduce his efforts by 
using python

Original comment by austinpa...@gmail.com on 19 Jan 2012 at 2:50

@GoogleCodeExporter
Copy link
Author

Original comment by gundl...@gmail.com on 19 Nov 2012 at 4:19

1 similar comment
@GoogleCodeExporter
Copy link
Author

Original comment by gundl...@gmail.com on 19 Nov 2012 at 4:19

@vadimFRG
Copy link

vadimFRG commented Oct 5, 2016

Trying the same same copy-paste .pyd files solution on Windows Server 2012 R2 with Python 3.5.0 and it does not work. I still get the same "DLL load failed" error.

@smohtasib
Copy link

@vadimFRG it may be realted to MSVCR100.dll, "Microsoft Visual C++ 2010 Redistributable Package"
incase its not installed, here is a link:

http://www.faqforge.com/windows/fix-the-program-cant-start-because-msvcr100-dll-is-missing-from-your-computer-error-on-windows/

@lmingzhi618
Copy link

lmingzhi618 commented Feb 19, 2017

I have the same problem for days, but one day I solved it.
After you installed the pywin32 libs, there is a directory "Lib/site-packages/pywin32_system32", which including three dll libs, copy them to the "/Lib/site-packages/win32" directory, which including the win32api.pyd or win32api.pyc.
There will be no ImportError Exception any more

@gshmu
Copy link

gshmu commented Apr 6, 2017

@mingzhi198 谢谢,这是pywin32.exe的bug。

@great-analyzer
Copy link

After you installed the pywin32 libs, there is a directory "Lib/site-packages/pywin32_system32", which including three dll libs, copy them to the "/Lib/site-packages/win32" directory, which including the win32api.pyd or win32api.pyc.

This works for me. For Python 3.6.1, there are 2 dll files to copy. Thanks, @mingzhi198.

@lmingzhi618
Copy link

@great-analyzer I am glad to help. And my environment is python 2.7.13.

@TrumanCai
Copy link

thanks @mingzhi198 @great-analyzer , I get the same error, too, and now solved.

@joshiji
Copy link

joshiji commented Feb 13, 2018

It solves the issue for me in python3.6.4. There were only 2 DLLs to be copied.

@pojda
Copy link

pojda commented Apr 16, 2018

Mine didn't work after a vanilla Python 2.7 install on Windows. Just ran
> pip install pywin32

and now everything works as expected

@SUSHMITAH
Copy link

I have the same problem for days, but one day I solved it.
After you installed the pywin32 libs, there is a directory "Lib/site-packages/pywin32_system32", which including three dll libs, copy them to the "/Lib/site-packages/win32" directory, which including the win32api.pyd or win32api.pyc.
There will be no ImportError Exception any more

Thanks a lot.I was stuck at this problem for a real long time.Saviour :)

@rakaliku
Copy link

rakaliku commented Oct 9, 2019

okay, just had a last moment doubt that i hadn't researched my problem well..

i found this:
http://code.activestate.com/lists/python-win32/10519/

and it seemed that win32*.pyd (which really are DLLs) could not be found, as 
according to that guy Frekin John

So i copied the 30 *.pyd files and placed them right next to 
C:\Python25\python.exe
and i tried the program again. It worked.

For all others out there just starting out:
30 files i copied constituted of 28 "win32*.pyd" name-form files, and remaining 
2 were "winxpgui.pyd" and "win2kras.pyd"

Happy programming!
BTW, authors of this wrapping, great work! This work of accessing the SAPI in C 
is really hectic (my friend is actually making a project on SR based action 
executor) and i wanted to show him he can drastically reduce his efforts by 
using python

Original comment by austinpa...@gmail.com on 19 Jan 2012 at 2:50

How can I get those DLL?I am newly learning .So bit confused here.
Also what are "winxpgui.pyd" and "win2kras.pyd" ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests