![](/img/trans.png)
[英]Microsoft Visual C++ 14.0 is required - error - pip install fbprophet
[英]Pip error: Microsoft Visual C++ 14.0 is required
我刚刚运行了以下命令:
pip install -U steem
并且安装运行良好,直到无法安装pycrypto
。 后来我做了
pip install cryptography
命令,因为我认为它是丢失的 package。所以我的问题是,如何在没有 pycrypto-error(或另外的 pycrypto-package)的情况下安装steem
,以及如何卸载我不需要的 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\
您需要安装 Microsoft Visual C++ 14.0 才能安装 pycrypto:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
编辑:备用链接: https ://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.2_standalone:_Build_Tools_for_Visual_Studio_2019_.28x86.2C_x64.2C_ARM.2C_ARM64.29
在评论中,您询问要使用哪个链接。 使用指向Visual C++ 2015 Build Tools的链接。 这将在不安装 Visual Studio 的情况下安装 Visual C++ 14.0。
在评论中,您询问了不需要安装编译器的安装pycrypto
的方法。 链接中的二进制文件似乎适用于比您使用的更早版本的 Python。 一个链接指向 DropBox 帐户中的二进制文件。
我不建议下载第三方提供的加密库的二进制版本。 保证您获得与您的 Python 版本兼容且未使用任何后门构建的pycrypto
版本的唯一方法是从源代码构建它。
安装 Visual C++ 后,只需重新运行原始命令:
pip install -U steem
要了解各种安装选项的含义,请运行以下命令:
pip help install
-U
选项的帮助说
-U, --upgrade Upgrade all specified packages to the newest available
version. The handling of dependencies depends on the
upgrade-strategy used.
如果你还没有安装steem
库,你可以运行不带-U
选项的命令。
即使在我的系统中安装了 Visual C++ 2015 (14.0),当我尝试安装 pymssql 时出现此错误。
我通过从这里下载 pymssql 的 .whl 文件解决了这个错误。
下载后,可以通过以下命令安装:
pip install python_package.whl
希望这可以帮助
我遇到了同样的问题。 在这里找到了修复。
基本上只要安装这个。
shasum输出:
3e0de8af516c15547602977db939d8c2e44fcc0b visualcppbuildtools_full.exe
md5sum 输出:
MD5 (visualcppbuildtools_full.exe) = 8d4afd3b226babecaa4effb10d69eb2e
再次运行您的 pip 安装命令。 如果一切正常,那就太好了。 或者你可能会像我一样面临以下错误:
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
在这里找到了解决上述问题的方法: Visual Studio can't build due to rc.exe
这基本上说
Add this to your PATH environment variables:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
Copy these files:
rc.exe
rcdll.dll
From
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
To
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
它就像一个魅力
作为安装 Visual C++ 的替代方法,有一种方法是在 Conda 中安装附加包(此选项不需要管理员权限)。 这对我有用:
conda install libpython m2w64-toolchain -c msys2
Pycrypto 的漏洞编号为CVE-2013-7459 ,并且该 repo 自2014 年 6 月 23 日起不接受 PR。
Pycryptodome是 PyCrypto 库的直接替代品,它公开了与旧 PyCrypto 几乎相同的 API,请参阅Compatibility with PyCrypto 。
如果您还没有安装 pycrypto,您可以使用pip install pycryptodome
安装 pycryptodome,您不会遇到 Microsoft Visual C++ 14.0 问题。
在 Windows 上,我强烈建议安装最新的Visual Stuido Community
,它是免费的,如果你只安装vc_redist
可能会错过一些构建工具,所以你可以通过pip
而不是wheel
轻松安装包,节省大量时间
我想安装psycopg2,但遇到此错误:需要Microsoft Visual C ++ 14.0。 使用“ Microsoft Visual C ++生成工具”获取它: https : //visualstudio.microsoft.com/downloads/
有解决方案: https : //stackoverflow.com/a/49986365/12341486
安装后,在终端中运行此命令:pip install psycopg2
希望这个能对您有所帮助...
尝试这样做:
py -m pip install pipwin
py -m pipwin install PyAudio
杀手级解决方案:安装nodejs
并勾选install chocolatey and other necessary tools...
它将安装设置开发环境所需的工具。
我针对此错误遵循的三个步骤:
让我们一劳永逸地解决这个问题(仅限 Anaconda 设置),请尝试:
conda install -c conda-forge 隐式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.