Not able to install package in windows

pip install jsonlib
Collecting jsonlib
Using cached jsonlib-1.6.1.tar.gz (43 kB)
Building wheels for collected packages: jsonlib
Building wheel for jsonlib (setup.py) … error
ERROR: Command errored out with exit status 1:
command: ‘c:\users\akash.kansal\appdata\local\programs\python\python37\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib\setup.py’"’"’; file=’"’"‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ bdist_wheel -d ‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-wheel-rjafnvju’
cwd: C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib
Complete output (31 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying jsonlib.py -> build\lib.win-amd64-3.7
running build_ext
building ‘_jsonlib’ extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\akash.kansal\appdata\local\programs\python\python37\include -Ic:\users\akash.kansal\appdata\local\programs\python\python37\include “-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt” "-IC:\Program Files
_jsonlib.c
_jsonlib.c(550): warning C4018: ‘<’: signed/unsigned mismatch
_jsonlib.c(643): warning C4020: ‘PyFloat_FromString’: too many actual parameters
_jsonlib.c(1186): warning C4013: ‘PyString_CheckExact’ undefined; assuming extern returning int
_jsonlib.c(1188): warning C4013: ‘PyString_Check’ undefined; assuming extern returning int
_jsonlib.c(1208): warning C4013: ‘PyObject_Unicode’ undefined; assuming extern returning int
_jsonlib.c(1208): warning C4047: ‘=’: ‘PyObject *’ differs in levels of indirection from ‘int’
_jsonlib.c(1406): warning C4013: ‘PyInt_CheckExact’ undefined; assuming extern returning int
_jsonlib.c(1517): warning C4013: ‘PyString_AS_STRING’ undefined; assuming extern returning int
_jsonlib.c(1517): warning C4047: ‘function’: ‘const char *’ differs in levels of indirection from ‘int’
_jsonlib.c(1517): warning C4024: ‘ascii_constant’: different types for formal and actual parameter 1
_jsonlib.c(1539): warning C4013: ‘PyInt_Check’ undefined; assuming extern returning int
_jsonlib.c(1931): warning C4047: ‘=’: ‘const char *’ differs in levels of indirection from ‘int’
_jsonlib.c(1970): warning C4047: ‘function’: ‘const char *’ differs in levels of indirection from ‘int’
_jsonlib.c(1970): warning C4024: ‘serializer_append_ascii’: different types for formal and actual parameter 2
_jsonlib.c(2161): warning C4013: ‘Py_InitModule3’ undefined; assuming extern returning int
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\akash.kansal\appdata\local\programs\python\python37\libs /LIBPATH:c:\users\akash.kansal\appdata\local\programs\python\python37\PCbuild\amd64 “/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\lib\x64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64” /EXPORT:PyInit__jsonlib build\temp.win-amd64-3.7\Release_jsonlib.obj /OUT:build\lib.win-amd64-3.7_jsonlib.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release_jsonlib.cp37-win_amd64.lib
LINK : error LNK2001: unresolved external symbol PyInit__jsonlib
build\temp.win-amd64-3.7\Release_jsonlib.cp37-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe’ failed with exit status 1120

ERROR: Failed building wheel for jsonlib
Running setup.py clean for jsonlib
Failed to build jsonlib
Installing collected packages: jsonlib
Running setup.py install for jsonlib … error
ERROR: Command errored out with exit status 1:
command: ‘c:\users\akash.kansal\appdata\local\programs\python\python37\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib\setup.py’"’"’; file=’"’"‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-record-ns_0zft2\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘c:\users\akash.kansal\appdata\local\programs\python\python37\Include\jsonlib’
cwd: C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying jsonlib.py -> build\lib.win-amd64-3.7
running build_ext
building ‘_jsonlib’ extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\akash.kansal\appdata\local\programs\python\python37\include -Ic:\users\akash.kansal\appdata\local\programs\python\python37\include “-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt” “-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt” /Tc_jsonlib.c /Fobuild\temp.win-amd64-3.7\Release_jsonlib.obj
_jsonlib.c
_jsonlib.c(550): warning C4018: ‘<’: signed/unsigned mismatch
_jsonlib.c(643): warning C4020: ‘PyFloat_FromString’: too many actual parameters
_jsonlib.c(1186): warning C4013: ‘PyString_CheckExact’ undefined; assuming extern returning int
_jsonlib.c(1188): warning C4013: ‘PyString_Check’ undefined; assuming extern returning int
_jsonlib.c(1208): warning C4013: ‘PyObject_Unicode’ undefined; assuming extern returning int
_jsonlib.c(1208): warning C4047: ‘=’: ‘PyObject *’ differs in levels of indirection from ‘int’
_jsonlib.c(1406): warning C4013: ‘PyInt_CheckExact’ undefined; assuming extern returning int
_jsonlib.c(1517): warning C4013: ‘PyString_AS_STRING’ undefined; assuming extern returning int
_jsonlib.c(1517): warning C4047: ‘function’: ‘const char *’ differs in levels of indirection from ‘int’
_jsonlib.c(1517): warning C4024: ‘ascii_constant’: different types for formal and actual parameter 1
_jsonlib.c(1539): warning C4013: ‘PyInt_Check’ undefined; assuming extern returning int
_jsonlib.c(1931): warning C4047: ‘=’: ‘const char *’ differs in levels of indirection from ‘int’
_jsonlib.c(1970): warning C4047: ‘function’: ‘const char *’ differs in levels of indirection from ‘int’
_jsonlib.c(1970): warning C4024: ‘serializer_append_ascii’: different types for formal and actual parameter 2
_jsonlib.c(2161): warning C4013: ‘Py_InitModule3’ undefined; assuming extern returning int
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\akash.kansal\appdata\local\programs\python\python37\libs /LIBPATH:c:\users\akash.kansal\appdata\local\programs\python\python37\PCbuild\amd64 “/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\lib\x64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64” “/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64” /EXPORT:PyInit__jsonlib build\temp.win-amd64-3.7\Release_jsonlib.obj /OUT:build\lib.win-amd64-3.7_jsonlib.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release_jsonlib.cp37-win_amd64.lib
LINK : error LNK2001: unresolved external symbol PyInit__jsonlib
build\temp.win-amd64-3.7\Release_jsonlib.cp37-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe’ failed with exit status 1120
----------------------------------------
ERROR: Command errored out with exit status 1: ‘c:\users\akash.kansal\appdata\local\programs\python\python37\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib\setup.py’"’"’; file=’"’"‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-install-16u7jp2c\jsonlib\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\AKASH~1.KAN\AppData\Local\Temp\pip-record-ns_0zft2\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘c:\users\akash.kansal\appdata\local\programs\python\python37\Include\jsonlib’ Check the logs for full command output.

That’s a really old package, are you sure you need it? Not modified since 2010, no binary wheels uploaded, and includes the note For the Python 3 version of jsonlib, see jsonlib-python3.

Python has a json module in the standard library, can you use that one instead?

Thanks Mat.

I got your point.