python 3.6 中安装 pycrypto 的问题

problems with installation pycrypto in python 3.6

我尝试使用 pip 在 python 3.6.0 上安装 pysnmp(它使用 pycrypto),但出现错误:

Command ""c:\program files (x86)\python36-32\python.exe" -u -c "import setuptools, tokenize;file='C: \Users\HOME-M~1\AppData\Local\Temp\pip-build-6l69kxa5\pycrypto\setup.py';f=getattr(tokenize, 'op en', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec')) " install --record C:\Users\HOME-M~1\AppData\Local\Temp\pip-qq93gmf_-record\install-record.txt --single- version-externally-managed --compile" failed with error code 1 in C:\Users\HOME-M~1\AppData\Local\Temp\p ip-build-6l69kxa5\pycrypto\

我不是高级用户,我一直没能想出解决这个问题的办法。如果您知道如何解决,请告诉我。 Python 3.5.2 轻松允许安装。

试试 PyCryptodome,它是 drop-in PyCrypto 的 drop-in 替代品。

$ pip install pycryptodome

或者,如果您选择 latest pysnmp,它明确依赖于 Pycryptodome。

$ pip install git+https://github.com/etingof/pysnmp.git

或者直接下载压缩包,解压到本地目录然后运行python setup.py install