t4ngo / dragonfly

ARCHIVED! - Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS) and Windows Speech Recognition (WSR)
GNU Lesser General Public License v3.0
364 stars 82 forks source link

import dragonfly fails due to ImportError: No module named win32gui #4

Closed muelli closed 10 years ago

muelli commented 10 years ago
In [1]: from dragonfly.all import Grammar, CompoundRule
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-77682f38bc09> in <module>()
----> 1 from dragonfly.all import Grammar, CompoundRule

/tmp/dragonfly/local/lib/python2.7/site-packages/dragonfly/__init__.py in <module>()
     20 
     21 #---------------------------------------------------------------------------
---> 22 from .log               import get_log
     23 from .config            import Config, Section, Item
     24 

/tmp/dragonfly/local/lib/python2.7/site-packages/dragonfly/log.py in <module>()
     28 import logging
     29 import logging.handlers
---> 30 import win32gui
     31 from win32com.shell import shell, shellcon
     32 

ImportError: No module named win32gui

In [2]: 
t4ngo commented 10 years ago

It appears that your Python interpreter cannot find the win32gui module, which is part of the Python for Windows Extensions, available here: http://sourceforge.net/projects/pywin32/

You probably can trigger this same import error by typing "import win32gui" in an interactive Python prompt, completely without Dragonfly. Please try that, and report the results here.

Please see these stack overflow threads for solutions to the import error: http://stackoverflow.com/questions/20113456/installing-win32gui-python-module http://stackoverflow.com/questions/6624672/how-to-use-the-win32gui-module-with-python

muelli commented 10 years ago

If pywin32 is a requirement, should it be listed in install_requires in setup.py?

t4ngo commented 10 years ago

Yes, I think you are right: pywin32 should be listed in install_requires in setup.py. Just committed that change.

erm3nda commented 8 years ago

I've installed just now Dragonfly module with Pip over Debian 8. It does finish the install, but when tried to run any sample script i got ImportError: No module named win32gui.

Even if I tried to install with sudo pip install win32gui, sudo pipinstall pywin32 and even sudo apt-get install python-win32 but there's no way to get it installed.

Can't I use Dragonfly on that system? If that, why did it installed? Thanks.

tylercal commented 8 years ago

Sorry to say, dragonfly only works on windows using dragon naturally speaking or WSR (windows speech recognition). It will not work on Debian or any other unix.

There are some clever solutions out there using virtual machines you can try, but it will take some research.

erm3nda commented 8 years ago

So, the question is, why is it installed on my Linux box? XD Can u recommend any alternative?

I've played alsasound, but looking for any already-made speech recognition.

Best regards, thank you.

himanshug-ezdi commented 6 years ago

I have also tried to install win32gui, pywin32 or python-win32 in Windows 10 but none of them gets installed. It shows an error 404 Not Found: python-win32@latest I have tried to install it using command npm install win32gui, npm install pywin32 and npm install python-win32. Does this module exist?

Thanks

reckoner commented 6 years ago

one thing you can try is to open a CMD window and type in python. Then, once in the interpreter window you can do

>>> import sys
>>> print sys.path # using Python 2.x

This will give you the list of places that the installed Python is searching to resolve modules. If do not see the win32 directories in there, then it means they were not installed in the correct path. For these modules in particular, it is usually better to install them using the .exe installers.

I hope that helps.

Aashima-Gupta commented 6 years ago

hi i installed win32gui for python 2.7.x however it is show error :

   Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\guptaa82\appdata\local\temp\pip-install-lbkp2d\win32gui\setup.py", line 27, in <module>
        from win32.distutils.gui import win32gui_build_ext
      File "win32\distutils\gui.py", line 10
        def iter_mfc(plat_name: str) ->Iterator[str]:
                              ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\guptaa82\appdata\local\temp\pip-install-lbkp2d\win32gui\
Aashima-Gupta commented 5 years ago

I have already checked all the stackoverflow links. I dont know why it is showing error in installing this part of the win32gui, Although i have installed pywin32 and pypiwin32 modules already and that shows no error.