• win10下Python安装pycrypto报错


    错误一:  error: Microsoft Visual C++ 14.0 is required.

    解决办法:

    原文 https://blog.csdn.net/heyshheyou/article/details/82022948

    错误二: 语法错误: 标识符“intmax_t”

    解决办法

            32位

            cd C:Program Files (x86)Microsoft Visual Studio2017CommunityVCAuxiliaryBuild      注  Community需要换成自己系统的值 比如我的是  Enterprise

            vcvarsall.bat  x86_amd64 

            set CL=-FI"%VCToolsInstallDir%includestdint.h

            pip install pycrypto

            

            64位

            cd C:Program Files (x86)Microsoft Visual Studio2017CommunityVCAuxiliaryBuild       注  Community需要换成自己系统的值 比如我的是  Enterprise

            vcvarsall.bat x64

            set CL=-FI"%VCToolsInstallDir%includestdint.h

            pip install pycrypto

    ===============================================================================

    附完整的错误提示: 

    1、python环境   

        >python -V

        Python 3.7.0

    2、pip install pycrypto报错如下 

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        27): error C2061: 语法错误: 标识符“intmax_t”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        28): error C2061: 语法错误: 标识符“rem”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        28): error C2059: 语法错误:“;”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        29): error C2059: 语法错误:“}”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        31): error C2061: 语法错误: 标识符“imaxdiv_t”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

            31): error C2059: 语法错误:“;”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        41): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        42): error C2146: 语法错误: 缺少“)”(在标识符“_Number”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        42): error C2061: 语法错误: 标识符“_Number”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        42): error C2059: 语法错误:“;”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        43): error C2059: 语法错误:“)”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        46): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        47): error C2146: 语法错误: 缺少“)”(在标识符“_Numerator”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        47): error C2061: 语法错误: 标识符“_Numerator”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        47): error C2059: 语法错误:“;”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

            47): error C2059: 语法错误:“,”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        49): error C2059: 语法错误:“)”

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        51): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        57): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        64): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        70): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        77): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        83): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        90): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtinttypes.h(

        96): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)

            error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Comm

        unity\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe' failed with exit

         status 2

            —————————————-

        Command "c:python37python.exe -u -c "import setuptools, tokenize;__file__='C:

        Users\ADMINI~1\AppData\Local\Temp\pip-install-bf6lznwz\pycrypto\setup.py

        ';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace(' ', ' '

        );f.close();exec(compile(code, __file__, 'exec'))" install –record C:UsersADM

        INI~1AppDataLocalTemppip-record-xxn48yyzinstall-record.txt –single-version

        -externally-managed –compile" failed with error code 1 in C:UsersADMINI~1App

        DataLocalTemppip-install-bf6lznwzpycrypto

    ==================================================================================

     错误三、以上办法均使用,仍然不好使,去网上找对应版本的whl,手动安装   pip installer pycrypto-2.6.1-cp35-cp35m-win_amd64.whl

             如我的是python35 64位电脑 对应的 资源地址为:pycrypto-2.6.1-cp35-cp35m-win_amd64.whl    

                  其它版本的whl 可以自行去网上搜索

              

    参考链接:https://www.centosdoc.com/dev/python/312.html

            https://www.e-learn.cn/content/python/2360819

         https://www.cnblogs.com/Elaine1/p/10180260.html

                      https://blog.csdn.net/HW140701/article/details/93494869

  • 相关阅读:
    kafka_consumer3->spark_master
    为什么.NET感觉上比Java差一点
    学习Scala: 初学者应该了解的知识
    函数式编程 : 一个程序猿进化的故事
    Scala underscore的用途
    不变(Invariant), 协变(Covarinat), 逆变(Contravariant) : 一个程序猿进化的故事
    Scala Collection简介
    C# on Visual Studio Code
    我的Machine Learning学习之路
    Scala on Visual Studio Code
  • 原文地址:https://www.cnblogs.com/xiohao/p/11216271.html
Copyright © 2020-2023  润新知