Pip error: Microsoft Visual C++ 14.0 is required

后端 未结 8 1806
离开以前
离开以前 2020-11-22 09:58

I just ran the following command:

pip install -U steem

and the installation worked well until it failed to install pycrypto. Aft

相关标签:
8条回答
  • 2020-11-22 10:25

    Pycrypto has vulnerabilities assigned the CVE-2013-7459 number, and the repo hasn't accept PRs since June 23, 2014.

    Pycryptodome is a drop-in replacement for the PyCrypto library, which exposes almost the same API as the old PyCrypto, see Compatibility with PyCrypto.

    If you haven't install pycrypto yet, you can use pip install pycryptodome to install pycryptodome in which you won't get Microsoft Visual C++ 14.0 issue.

    0 讨论(0)
  • 2020-11-22 10:27

    On Windows, I strongly recommand installing latest Visual Stuido Community, it's free, you will maybe miss some build tools if you only install vc_redist, so you can easily install package by pip instead of wheel, it save lot of time

    0 讨论(0)
  • 2020-11-22 10:34

    You need to install Microsoft Visual C++ 14.0 to install 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
    

    In the comments you ask which link to use. Use the link to Visual C++ 2015 Build Tools. That will install Visual C++ 14.0 without installing Visual Studio.

    In the comments you ask about methods of installing pycrypto that do not require installing a compiler. The binaries in the links appear to be for earlier versions of Python than you are using. One link is to a binary in a DropBox account.

    I do not recommend downloading binary versions of cryptography libraries provided by third parties. The only way to guarantee that you are getting a version of pycrypto that is compatible with your version of Python and has not been built with any backdoors is to build it from the source.

    After you have installed Visual C++, just re-run the original command:

    pip install -U steem
    

    To find out what the various install options mean, run this command:

    pip help install
    

    The help for the -U option says

    -U, --upgrade        Upgrade all specified packages to the newest available
                         version. The handling of dependencies depends on the
                         upgrade-strategy used.
    

    If you do not already have the steem library installed, you can run the command without the -U option.

    0 讨论(0)
  • 2020-11-22 10:34

    If you already have Visual Studio Build Tools installed but you're still getting that error, then you may need to "Modify" your installation to include the Visual C++ build tools.

    To do that:

    1. Open up the Visual Studio Installer (you can search for it in the Start Menu if needed).

    2. Find Visual Studio Build Tools and click "Modify":

    1. Add a checkmark to Visual C++ build tools and then click "Modify" in the bottom right to install them:

    After the C++ tools finish installing, run the pip command again and it should work.

    0 讨论(0)
  • 2020-11-22 10:34

    I landed on this question after searching for "Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools". I got this error in Azure DevOps when trying to run pip install to build my own Python package from a source distribution that had C++ extensions. In the end all I had to do was upgrade setuptools before calling pip install:

    pip install --upgrade setuptools
    

    So the advice here about updating setuptools when installing from source archives is right after all:). That advice is given here too.

    0 讨论(0)
  • 2020-11-22 10:39

    As an alternative to installing Visual C++, there is a way by installing an additional package in Conda (this option doesn't require admin rights). This worked for me:

    conda install libpython m2w64-toolchain -c msys2
    
    0 讨论(0)
提交回复
热议问题