zoukankan      html  css  js  c++  java
  • pip安装ujson报错: error:Microsoft Visual C++ 14.0 is required

    在win10上pip安装ujson报错

    之前一直用的是mac本,但由于疫情问题,最近不得不用win10系统来进行python开发,在使用pip安装依赖包ujson时,遇到了问题,如下:

    (custom_itsm) D:DEVELOPitemshn_test>pip install ujson
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no
     longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip
    , can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Collecting ujson
      Using cached ujson-1.35.tar.gz (192 kB)
    Building wheels for collected packages: ujson
      Building wheel for ujson (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: 'd:developvirtaulcustom_itsmscriptspython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '
    "'"'c:\users\ysss\appdata\local\temp\pip-install-taurl6\ujson\setup.py'"'"'; __file__='"'"'c:\users\ysss\appd
    ata\local\temp\pip-install-taurl6\ujson\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.re
    ad().replace('"'"'
    '"'"', '"'"'
    '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'c:u
    sersysssappdatalocal	emppip-wheel-jzkbhc'
           cwd: c:usersysssappdatalocal	emppip-install-taurl6ujson
      Complete output (5 lines):
      running bdist_wheel
      running build
      running build_ext
      building 'ujson' extension
      error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
    
    

    问题很明显:Microsoft Visual C++ 9.0 is required。意思是缺少编译ujson的C++编译工具,本来想按照提示去http://aka.ms/vcpython27网站下载所需要的依赖,
    但经过一番尝试失败了。不过经过一番搜索,最终还是找到了就解决办法:

    下载whl文件直接安装(Python2和Python3适用)

    下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs
    找到并下载所需要的whl文件。

    放到项目中,并安装:pip install xxx.whhl

  • 相关阅读:
    SqlServer2008启动不了的问题
    .exe 不包含适合入口点的静态“Main”方法
    两种常用的序列化
    异或运算^
    SqlServer数据库实现C#中的split功能
    遍历电脑下面所有文件--递归
    ExecuteNonQuery引发了System.ArgumentException类型异常
    JQuery属性过滤(转)
    SQL SERVER 执行远端数据库的SQL命令
    马云:做一个静静的观察者 能学到更多
  • 原文地址:https://www.cnblogs.com/wangyingblock/p/12272497.html
Copyright © 2011-2022 走看看