【发布时间】:2020-04-13 22:39:17
【问题描述】:
当 pip 为加密包构建轮子时出现错误。
错误:
LINK : fatal error LNK1181: cannot open input file 'libssl.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
----------------------------------------
ERROR: Failed building wheel for cryptography
Running setup.py clean for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
我已经安装了 OpenSSL 并按照this post 中的建议设置了环境变量,但问题仍然存在。我的设置详情:
- 系统 - Windows 10
- Python - 3.8
- 点 - 19.3.1
【问题讨论】:
-
在 Windows 上构建加密是一个非常复杂的过程,除非您尝试安装较旧的加密版本,否则不需要它。密码学为密码学 2.8+ 提供 Python 3.8 windows 轮子。如果你直接运行
pip install cryptography会发生什么? -
直接安装就可以了。但是,当我将它作为 requirements.txt 的一部分安装时,会显示此错误。我应该如何禁用构建轮子的选项?如果我这样做会有什么后果?
-
在我的情况下,有必要将 pip 更新到最新版本
-
@dreo 我已经更新了 Pip 但它仍然为包构建轮子
-
requirements.txt 是否将加密固定到版本
标签: python pip cryptography python-cryptography