ImportError: DLL load failed: win32api, sys, os
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 [email protected] on 19 Jan 2012 at 2:33
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 [email protected] on 19 Jan 2012 at 2:50
Original comment by [email protected] on 19 Nov 2012 at 4:19
Original comment by [email protected] on 19 Nov 2012 at 4:19
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.
@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/
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
@mingzhi198 谢谢,这是pywin32.exe的bug。
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.
@great-analyzer I am glad to help. And my environment is python 2.7.13.
thanks @mingzhi198 @great-analyzer , I get the same error, too, and now solved.
It solves the issue for me in python3.6.4. There were only 2 DLLs to be copied.
Mine didn't work after a vanilla Python 2.7 install on Windows. Just ran
> pip install pywin32
and now everything works as expected
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 :)
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 pythonOriginal comment by
[email protected]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" ??