私はSendKeys for Pythonをインストールしようとしています。SendKeysのインストールとインポートのトラブル - アップデート
私は
pip install SendKeys
を使用している場合は、私がリンクエラーを取得:
_sendkeys.c(150): warning C4013: 'Py_InitModule' undefined; assuming extern returning int
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED, \10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)
LINK : error LNK2001: unresolved external symbol PyInit__sendkeys
build\temp.win-amd64-3.5\Release\_sendkeys.cp35-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1120
私は64ビットの.whlをダウンロードし、ローカルピップでそれをインストールしようと私が手:
sendkeys-0.3-cp27-none-win_amd64.whl is not a supported wheel on this platform.
32ビットバージョンを試しても同じエラーが発生します。
ピップが最新です。 Visual Studioのセットアップに何か問題がありますか?
--Update--
私は、Visual StudioでのPythonモジュールを更新した後のSendKeysをintallすることができましたが、私はのSendKeys
>>> import SendKeys
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\...\AppData\Continuum\Anaconda3\lib\site-packages\sendkeys-0.3-py3.5-win-amd64.egg\SendKeys.py", line 419
except (ValueError,AssertionError),e:
SyntaxError: invalid syntax
にそのコードをインポートしようとすると、私は次のエラーを取得しますスローエラーがメインである:
def main(args=None):
import getopt
if args is None:
args = sys.argv[1:]
try:
opts,args = getopt.getopt(args,
"hp:d:f:", ["help","pause","delay","file"])
except getopt.GetoptError:
usage()
pause=0
delay=0
filename=None
for o, a in opts:
if o in ('-h','--help'):
usage()
elif o in ('-f','--file'):
filename = a
elif o in ('-p','--pause'):
try:
pause = float(a)
assert pause >= 0
except (ValueError,AssertionError),e:
error('`pause` must be >= 0.0')
elif o in ('-d','--delay'):
try:
delay = float(a)
assert delay >= 0
except (ValueError,AssertionError),e:
error('`delay` must be >= 0.0')
time.sleep(delay)
^
これは私にpipと同じリンクエラーを与えますが、別のディレクトリを参照していました。 – Jim