PS C:\Users\Lenovo> pip install pickle5
Collecting pickle5
Using cached pickle5-0.0.11.tar.gz (132 kB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for pickle5, since package 'wheel' is not installed.
Installing collected packages: pickle5
Running setup.py install for pickle5 ... error
error: subprocess-exited-with-error
× Running setup.py install for pickle5 did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\pickle5
copying pickle5\pickle.py -> build\lib.win-amd64-3.10\pickle5
copying pickle5\pickletools.py -> build\lib.win-amd64-3.10\pickle5
copying pickle5\__init__.py -> build\lib.win-amd64-3.10\pickle5
creating build\lib.win-amd64-3.10\pickle5\test
copying pickle5\test\pickletester.py -> build\lib.win-amd64-3.10\pickle5\test
copying pickle5\test\test_pickle.py -> build\lib.win-amd64-3.10\pickle5\test
copying pickle5\test\test_picklebuffer.py -> build\lib.win-amd64-3.10\pickle5\test
copying pickle5\test\__init__.py -> build\lib.win-amd64-3.10\pickle5\test
running build_ext
building 'pickle5._pickle' extension
creating build\temp.win-amd64-3.10
creating build\temp.win-amd64-3.10\Release
creating build\temp.win-amd64-3.10\Release\pickle5
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\include -IC:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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\shared -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\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /Tcpickle5/_pickle.c /Fobuild\temp.win-amd64-3.10\Release\pickle5/_pickle.obj
_pickle.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\include -IC:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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\shared -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\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /Tcpickle5/picklebufobject.c /Fobuild\temp.win-amd64-3.10\Release\pickle5/picklebufobject.obj
picklebufobject.c
pickle5/picklebufobject.c(20): warning C4273: 'PyPickleBuffer_FromObject': inconsistent dll linkage
C:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\include\cpython/picklebufobject.h(18): note: see previous definition of 'PyPickleBuffer_FromObject'
pickle5/picklebufobject.c(39): warning C4273: 'PyPickleBuffer_GetBuffer': inconsistent dll linkage
C:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\include\cpython/picklebufobject.h(22): note: see previous definition of 'PyPickleBuffer_GetBuffer'
pickle5/picklebufobject.c(58): warning C4273: 'PyPickleBuffer_Release': inconsistent dll linkage
C:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\include\cpython/picklebufobject.h(24): note: see previous definition of 'PyPickleBuffer_Release'
pickle5/picklebufobject.c(208): warning C4273: 'PyPickleBuffer_Type': inconsistent dll linkage
C:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\include\cpython/picklebufobject.h(13): note: see previous definition of 'PyPickleBuffer_Type'
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\libs /LIBPATH:C:\Users\Lenonvo\AppData\Local\Programs\Python\Python310\PCbuild\amd64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\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__pickle build\temp.win-amd64-3.10\Release\pickle5/_pickle.obj build\temp.win-amd64-3.10\Release\pickle5/picklebufobject.obj /OUT:build\lib.win-amd64-3.10\pickle5\_pickle.cp310-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.10\Release\pickle5\_pickle.cp310-win_amd64.lib
python310.lib(python310.dll) : error LNK2005: PyPickleBuffer_GetBuffer already defined in picklebufobject.obj
Creating library build\temp.win-amd64-3.10\Release\pickle5\_pickle.cp310-win_amd64.lib and object build\temp.win-amd64-3.10\Release\pickle5\_pickle.cp310-win_amd64.exp
build\lib.win-amd64-3.10\pickle5\_pickle.cp310-win_amd64.pyd : fatal error LNK1169: one or more multiply defined symbols found
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\link.exe' failed with exit code 1169
[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.
╰─> pickle5
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
CodePudding user response:
You only need pickle5
, a module backporting Pickle protocol 5 features to older Pythons when running on Python versions older than 3.8.
As evident from Python310
and -3.10
in the output, you're on Python 3.10. You don't need pickle5
.
Thus, the answer to "what should you do", without us not knowing more details about your situation, is "not try to install pickle5
".