可执行安装程序位于 http://www.rutherfurd.net/python/sendkeys/#version -history 被我的公司防火墙阻止,因此我尝试从源代码安装。以前从未这样做过。
尝试将源内容复制到 C:\Python26\Lib\site-packages\SendKeys-0.3,并在 Eclipse Pydev 项目的 Pythonpath 属性中将该文件夹指向为外部库。仍然收到“ImportError:没有名为 SendKeys 的模块”。
除了 SendKeys.py 之外,该文件夹还有一个 setup.py(我尝试运行)和一个 _sendkeys.c(我从未编译过)。我感觉我错过了一些“安装”步骤,但我不知道该怎么做,也无法在网上找到它。
任何提示或指示表示赞赏。
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-packages\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.
发布评论
评论(2)
setup.py
需要一个命令。运行setup.py install。setup.py
needs a command. Runsetup.py install
.我知道这已经很旧了,但我自己设法让它工作,并且花了我相当多的时间来解决它。
因此,作为参考,您需要执行以下操作来将系统设置为从源代码编译(您可以通过其他方式达到您的目标,但我认为这是最简单的一种):
\bin\
到您的路径。在 python 安装目录(或 virtualenv)中,使用以下内容创建文件 Lib\distutils\distutils.cfg
<前><代码>[构建]
编译器=mingw32
最后,下载sendkeys(我从此处,因为我尝试时官方网站已关闭),解压、cd 并运行 python 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):
<mingw-install-dir>\bin\
to your path.In your python installation directory (or virtualenv), create the file Lib\distutils\distutils.cfg with the contents
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