我刚刚运行了以下命令:
pip install -U steem
并且安装运行良好,直到无法安装 pycrypto
。之后我做了
pip install cryptography
命令,因为我认为它是丢失的包。所以我的问题是,我如何安装 steem
没有 pycrypto-error(或另外的 pycrypto-package)以及如何卸载我不需要的 cryptography-Package。 (我使用的是 Windows 7 和 Python 3)
Requirement already up-to-date: python-dateutil in c:\users\***\appdata\lo
cal\programs\python\python36\lib\site-packages (from dateparser->maya->steem)
...
Installing collected packages: urllib3, idna, chardet, certifi, requests, pycryp
to, funcy, w3lib, voluptuous, diff-match-patch, scrypt, prettytable, appdirs, la
ngdetect, ruamel.yaml, humanize, tzlocal, regex, dateparser, pytzdata, pendulum,
maya, ecdsa, pylibscrypt, ujson, toolz, steem
Running setup.py install for pycrypto ... error
Complete output from command c:\users\***\appdata\local\programs\pytho
n\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\
***~1\\AppData\\Local\\Temp\\pip-build-k6flhu5k\\pycrypto\\setup.py';f=getattr(
tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();
exec(compile(code, __file__, 'exec'))" install --record C:\Users\***N~1\AppDat
a\Local\Temp\pip-igpkll6u-record\install-record.txt --single-version-externally-
managed --compile:
running install
running build
running build_py
...
building 'Crypto.Random.OSRNG.winrandom' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "c:\users\***\appdata\local\programs\python\python36\python.exe -u
-c "import setuptools, tokenize;__file__='C:\\Users\\***N~1\\AppData\\Local\\
Temp\\pip-build-k6flhu5k\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(
__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __fil
e__, 'exec'))" install --record C:\Users\***N~1\AppData\Local\Temp\pip-igpkll6
u-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in C:\Users\***N~1\AppData\Local\Temp\pip-build- k6flhu5k\p
ycrypto\
原文由 Studentu 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要安装 Microsoft Visual C++ 14.0 才能安装 pycrypto:
在评论中,您询问要使用哪个链接。使用指向 Visual C++ 2015 Build Tools 的链接。这将在不安装 Visual Studio 的情况下安装 Visual C++ 14.0。
备用链接: https ://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.2_standalone:_Build_Tools_for_Visual_Studio2019.28x86.2C_x64.2C_ARM.2C_ARM64.29
在评论中,您询问了不需要安装编译器的安装方法
pycrypto
。链接中的二进制文件似乎适用于比您使用的更早版本的 Python。一个链接指向 DropBox 帐户中的二进制文件。我不建议下载第三方提供的加密库的二进制版本。保证您获得与您的 Python 版本兼容且未使用任何后门构建的
pycrypto
版本的唯一方法是从源代码构建它。安装 Visual C++ 后,只需重新运行原始命令:
要了解各种安装选项的含义,请运行以下命令:
-U
选项的帮助说如果您尚未安装
steem
库,则可以在没有-U
选项的情况下运行该命令。