首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python中的ujson包安装错误

Python中的ujson包安装错误
EN

Stack Overflow用户
提问于 2021-01-28 02:42:04
回答 1查看 299关注 0票数 0

当我尝试在Windows10上安装Python3.6中的ujson包时(这是安装binance-python库所必需的),我得到了这个错误:

代码语言:javascript
复制
C:\Users\MHT\python_projects\crypto\env\Scripts
(env) λ pip install ujson
Collecting ujson
  Using cached ujson-4.0.2.tar.gz (7.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: ujson
  Building wheel for ujson (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\mht\python_projects\crypto\env\scripts\python.exe' 'c:\users\mht\python_projects\crypto\env\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\MHT\AppData\Local\Temp\tmpfwaht9wj'
       cwd: C:\Users\MHT\AppData\Local\Temp\pip-install-97ynb6ua\ujson_0cc2905684bb497985ff0e4ac258eafe
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'ujson' extension
  creating build
  creating build\temp.win32-3.6
  creating build\temp.win32-3.6\Release
  creating build\temp.win32-3.6\Release\deps
  creating build\temp.win32-3.6\Release\deps\double-conversion
  creating build\temp.win32-3.6\Release\deps\double-conversion\double-conversion
  creating build\temp.win32-3.6\Release\lib
  creating build\temp.win32-3.6\Release\python
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I./python -I./lib -I./deps/double-conversion/double-conversion -Ic:\users\mht\python_projects\crypto\env\include -Ic:\users\mht\appdata\local\programs\python\python36-32\include -Ic:\users\mht\appdata\local\programs\python\python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" /EHsc /Tp./deps/double-conversion/double-conversion\bignum-dtoa.cc /Fobuild\temp.win32-3.6\Release\./deps/double-conversion/double-conversion\bignum-dtoa.obj -D_GNU_SOURCE
  bignum-dtoa.cc
  ./deps/double-conversion/double-conversion\bignum-dtoa.cc(28): fatal error C1083: Cannot open include file: 'math.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for ujson
Failed to build ujson
ERROR: Could not build wheels for ujson which use PEP 517 and cannot be installed directly

我该怎么解决这个问题呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-28 02:45:47

尝试安装Visual Studio,此处:https://visualstudio.microsoft.com/。通常,包依赖于Visual Studio for C/C++编译器。

它似乎因为运行以下命令而终止:

代码语言:javascript
复制
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

失败。安装Visual Studio应该可以解决这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65925396

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档