• Python3.6 安装pip install alipay-sdk-python 遇到pycrypto安装错误


    Python3.6 安装pip install alipay-sdk-python 遇到pycrypto安装错误:

    pip install pycrypto

    如果是Windows系统,到这里可能安装出错了,可能出现的错误如下:

    • error: command ‘cl.exe’ failed: No such file or directory
    • error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe’ failed with exit status 2
    • error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualstudio.com/visual-cpp-build-tools

    我的已安装有了,

    完成安装之后,我们进行环境变量中用户变量(不是系统变量)的设置。

    变量名称:VCINSTALLDIR

    变量值:C:Program Files (x86)Microsoft Visual Studio 14.0VC

    接下来,打开cmd,执行如下命令:

    set CL=/FI"%VCINSTALLDIR%\INCLUDE\stdint.h" %CL%

    注意:如果是虚拟环境,请在虚拟环境的命令行中输入此命令,并且命令中的符号都是英文半角的,网上有的资料中引号是中文符号,导致仍然无法安装Pycrypto(我特么就是受害者…)。

    如果还报错误“src/winrand.c: fatal error C1083: Cannot open include file: ‘%VCINSTALLDIR%\INCLUDE\stdint.h’: No such file or directory”,可以尝试把命令改为绝对路径。我的就是这个:

    set CL=/FI"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\stdint.h" %CL%

    完成上述步骤之后,重新执行安装Pycrypto的命令,就应该不出什么问题了。

    注意:建议每次执行上述命令时,先通过“set CL=”命令,将已有设置清空。

    继续安装alipay-sdk-python。

  • 相关阅读:
    coding 绑定 ssh 公钥后 还报没有权限???
    定位方法 xpath,css
    css 定位方法
    pyse
    kafka自动安装脚本systemctl服务
    Visual Studio Code(VS Code)插件
    2022最新web前端面试题分享pdf 170页
    浏览器缓存机制介绍与缓存策略剖析
    前端性能优化攻略
    linux中用wget下载整个网页以及子网页
  • 原文地址:https://www.cnblogs.com/liuye1990/p/13386685.html
Copyright © 2020-2023  润新知