Install SendKeys from source in Pydev (Windows)
The executable installer at http://www.rutherfurd.net/python/sendkeys/#version-history is blocked by my corporate firewall, so I'm trying to install from source. Never done it before.
Tried copying the source contents to C:\Python26\Lib\site-packa开发者_StackOverflow中文版ges\SendKeys-0.3, and pointing to the folder as an external library in the Pythonpath Property of my Eclipse Pydev project. Still getting an "ImportError: No module named SendKeys".
Besides SendKeys.py, the folder also has a setup.py, which I tried running, and a _sendkeys.c, which I never compiled. I sense I'm missing some 'install' step, but I don't know how to do it and couldn't find it online.
Any tips or pointers are appreciated.
setup.py
needs a command. Run setup.py install
.
I know this is old, but I managed to get this working myself, and it took me a fair amount of time to sort it out.
So, for reference, here is what you need to do to set up your system to compile from source (you can reach your goal by other means, but I consider this the easiest one):
- Install mingw (install it including the gui). Don't quit the installer, click on Continue.
- Choose base and gcc and install those from within the gui installer.
- Add
<mingw-install-dir>\bin\
to your path. In your python installation directory (or virtualenv), create the file Lib\distutils\distutils.cfg with the contents
[build] compiler=mingw32
- For python < 2.7.6, in your python directory, remove all occurrences of -mno-cygwin from the file cygwinccompiler.py
Finally, download sendkeys (i got it from here since the official site was down when I tried), unpack, cd, and run python setup.py install
精彩评论