GitHubShen / robotframework-autoitlibrary

Automatically exported from code.google.com/p/robotframework-autoitlibrary
Apache License 2.0
0 stars 0 forks source link

Unable to install on virtualenv #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a virtual env
2. Install dependencies in virtual env
3. Install in virtualenv

Expected result: installation succeed

Current result: error is raised  "AutoItLibrary requires win32com. See 
http://starship.python.net/crew/mhammond/win32/."

Seen on 1.1

Problem is due to installation of pywin32 under virtualenv, win32com folder is 
not created under site-packages folder but in 
site-packages\pywin32....egg\win32com

Potential fix:
in setup.py:

replace (line 71)

            makepy = os.path.normpath(os.path.join(get_python_lib(), "win32com/client/makepy.py"))
            #
            # Make sure we have win32com installed
            #
            if not os.path.isfile(makepy) :
                print "AutoItLibrary requires win32com. See http://starship.python.net/crew/mhammond/win32/."
                sys.exit(2)

by

try:
                import win32com.client.makepy
                makepy = os.path.normpath(os.path.join(os.path.dirname(win32com.client.makepy.__file__), 'makepy.py'))
                #makepy = os.path.normpath(os.path.join(get_python_lib(), "win32com/client/makepy.py"))
                #
                # Make sure we have win32com installed
                #

            except ImportError:
                print "AutoItLibrary requires win32com. See http://starship.python.net/crew/mhammond/win32/."
                sys.exit(2)

With this patch, win32com location is detected using python import module 
mechanism (no more hard coded values)

setup.py attached

Original issue reported on code.google.com by ageff...@gmail.com on 20 Jun 2014 at 9:09

Attachments: