Reputation: 161
Due to Error 1 (below) I've downloaded an installer via the URL at the last line of the error. "Visual Studio Build Tools 2022 - 17.4.4" window has popped up with many options of things to install so I just choose "C++" as it said.
Then when I try run 'pip install jsonlib' again, I get error 2 (below again). I googled "exit code 1120" and it says something about linker and no need to fix error as it goes away...
I've tried restarting after installing windows c++ VS build tools and re-opened cmd.
Someone linked to this python page on another stack but no further explanation and I'm not sure what it means https://wiki.python.org/moin/WindowsCompilers
ERROR 1 :
C:\Users\sheld>pip install jsonlib
Collecting jsonlib
Downloading jsonlib-1.6.1.tar.gz (43 kB)
---------------------------------------- 43.8/43.8 kB 2.2 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Installing collected packages: jsonlib
DEPRECATION: jsonlib is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for jsonlib ... error
error: subprocess-exited-with-error
× Running setup.py install for jsonlib did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
running install
C:\Users\sheld\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
copying jsonlib.py -> build\lib.win-amd64-cpython-311
running build_ext
building '_jsonlib' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
ERROR 2:
C:\Users\sheld>pip install jsonlib
Collecting jsonlib
Using cached jsonlib-1.6.1.tar.gz (43 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: jsonlib
DEPRECATION: jsonlib is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for jsonlib ... error
error: subprocess-exited-with-error
× Running setup.py install for jsonlib did not run successfully.
│ exit code: 1
╰─> [59 lines of output]
running install
C:\Users\sheld\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
copying jsonlib.py -> build\lib.win-amd64-cpython-311
running build_ext
building '_jsonlib' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\sheld\AppData\Local\Programs\Python\Python311\include -IC:\Users\sheld\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /Tc_jsonlib.c /Fobuild\temp.win-amd64-cpython-311\Release\_jsonlib.obj
_jsonlib.c
_jsonlib.c(98): warning C4996: 'PyUnicode_AsUnicode': deprecated in 3.3
_jsonlib.c(99): warning C4996: 'PyUnicode_GetSize': deprecated in 3.3
_jsonlib.c(310): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(348): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(396): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(450): warning C4013: 'PyLong_FromUnicode' undefined; assuming extern returning int
_jsonlib.c(450): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
_jsonlib.c(550): warning C4018: '<': signed/unsigned mismatch
_jsonlib.c(643): warning C4020: 'PyFloat_FromString': too many actual parameters
_jsonlib.c(656): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
_jsonlib.c(638): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_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(1466): warning C4996: 'PyUnicode_AS_UNICODE': deprecated in 3.3
_jsonlib.c(1467): warning C4996: 'PyUnicode_GET_SIZE': deprecated in 3.3
_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(1702): warning C4996: 'PyUnicode_AS_UNICODE': deprecated in 3.3
_jsonlib.c(1703): warning C4996: 'PyUnicode_GET_SIZE': deprecated in 3.3
_jsonlib.c(1751): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(1755): warning C4996: 'PyUnicode_AS_UNICODE': deprecated in 3.3
_jsonlib.c(1782): warning C4996: 'PyUnicode_AS_UNICODE': deprecated in 3.3
_jsonlib.c(1783): warning C4996: 'PyUnicode_GET_SIZE': deprecated in 3.3
_jsonlib.c(1821): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(1825): warning C4996: 'PyUnicode_AS_UNICODE': deprecated in 3.3
_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(1993): warning C4996: 'PyUnicode_AS_UNICODE': deprecated in 3.3
_jsonlib.c(1994): warning C4996: 'PyUnicode_GET_SIZE': deprecated in 3.3
_jsonlib.c(2089): warning C4013: 'PyUnicode_Encode' undefined; assuming extern returning int
_jsonlib.c(2090): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
_jsonlib.c(2095): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(2124): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
_jsonlib.c(2129): warning C4996: 'PyUnicode_FromUnicode': deprecated in 3.3
_jsonlib.c(2161): warning C4013: 'Py_InitModule3' undefined; assuming extern returning int
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\sheld\AppData\Local\Programs\Python\Python311\libs /LIBPATH:C:\Users\sheld\AppData\Local\Programs\Python\Python311 /LIBPATH:C:\Users\sheld\AppData\Local\Programs\Python\Python311\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x64" /EXPORT:PyInit__jsonlib build\temp.win-amd64-cpython-311\Release\_jsonlib.obj /OUT:build\lib.win-amd64-cpython-311\_jsonlib.cp311-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-311\Release\_jsonlib.cp311-win_amd64.lib
LINK : error LNK2001: unresolved external symbol PyInit__jsonlib
build\temp.win-amd64-cpython-311\Release\_jsonlib.cp311-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> jsonlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Upvotes: 0
Views: 910