Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
355 views
in Technique[技术] by (71.8m points)

windows - how to solve ujson package installation error in python

when I try to install ujson package in python 3.6 on windows 10, (which is needed for binance-python library installation) I got this error:

C:UsersMHTpython_projectscryptoenvScripts
(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:usersmhtpython_projectscryptoenvscriptspython.exe' 'c:usersmhtpython_projectscryptoenvlibsite-packagespip\_vendorpep517\_in_process.py' build_wheel 'C:UsersMHTAppDataLocalTempmpfwaht9wj'
       cwd: C:UsersMHTAppDataLocalTemppip-install-97ynb6uaujson_0cc2905684bb497985ff0e4ac258eafe
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'ujson' extension
  creating build
  creating buildemp.win32-3.6
  creating buildemp.win32-3.6Release
  creating buildemp.win32-3.6Releasedeps
  creating buildemp.win32-3.6Releasedepsdouble-conversion
  creating buildemp.win32-3.6Releasedepsdouble-conversiondouble-conversion
  creating buildemp.win32-3.6Releaselib
  creating buildemp.win32-3.6Releasepython
  C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333inHostX86x86cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I./python -I./lib -I./deps/double-conversion/double-conversion -Ic:usersmhtpython_projectscryptoenvinclude -Ic:usersmhtappdatalocalprogramspythonpython36-32include -Ic:usersmhtappdatalocalprogramspythonpython36-32include "-IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include" /EHsc /Tp./deps/double-conversion/double-conversionignum-dtoa.cc /Fobuildemp.win32-3.6Release./deps/double-conversion/double-conversionignum-dtoa.obj -D_GNU_SOURCE
  bignum-dtoa.cc
  ./deps/double-conversion/double-conversionignum-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

please help me for solving this problem in windows 10

question from:https://stackoverflow.com/questions/65925396/how-to-solve-ujson-package-installation-error-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try to install Visual Studio, here: https://visualstudio.microsoft.com/. Often, packages depend on Visual Studio for compilers and other items.

It appears it terminates because running the below command:

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

failed. Installing Visual studio may fix this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...