无法在anaconda中安装pickle5

问题描述 投票:0回答:1
Collecting pickle5
  Using cached pickle5-0.0.11.tar.gz (132 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pickle5
  Building wheel for pickle5 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\pickle5
      copying pickle5\pickle.py -> build\lib.win-amd64-cpython-311\pickle5
      copying pickle5\pickletools.py -> build\lib.win-amd64-cpython-311\pickle5
      copying pickle5\__init__.py -> build\lib.win-amd64-cpython-311\pickle5
      creating build\lib.win-amd64-cpython-311\pickle5\test
      copying pickle5\test\pickletester.py -> build\lib.win-amd64-cpython-311\pickle5\test
      copying pickle5\test\test_pickle.py -> build\lib.win-amd64-cpython-311\pickle5\test
      copying pickle5\test\test_picklebuffer.py -> build\lib.win-amd64-cpython-311\pickle5\test
      copying pickle5\test\__init__.py -> build\lib.win-amd64-cpython-311\pickle5\test
      running build_ext
      building 'pickle5._pickle' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\pickle5
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\amitr\anaconda3\envs\multiple_disease\include -IC:\Users\amitr\anaconda3\envs\multiple_disease\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcpickle5/_pickle.c /Fobuild\temp.win-amd64-cpython-311\Release\pickle5/_pickle.obj
      _pickle.c
      pickle5/_pickle.c(464): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(491): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(542): error C2105: '--' needs l-value
      pickle5/_pickle.c(552): error C2105: '++' needs l-value
      pickle5/_pickle.c(582): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(599): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(1285): warning C4013: '_PyObject_CallNoArg' undefined; assuming extern returning int
      pickle5/_pickle.c(1285): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
      pickle5/_pickle.c(1937): warning C4013: '_PySys_GetObjectId' undefined; assuming extern returning int
      pickle5/_pickle.c(1937): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
      pickle5/_pickle.c(2255): warning C4013: '_PyFloat_Pack8' undefined; assuming extern returning int
      pickle5/_pickle.c(4452): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'int'
      pickle5/_pickle.c(5428): warning C4013: '_PyFloat_Unpack8' undefined; assuming extern returning int
      pickle5/_pickle.c(6178): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(6535): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(6541): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(6663): error C2106: '=': left operand must be l-value
      pickle5/_pickle.c(6668): error C2106: '=': left operand must be l-value
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pickle5
  Running setup.py clean for pickle5
Failed to build pickle5
ERROR: Could not build wheels for pickle5, which is required to install pyproject.toml-based projects

我尝试安装 c++ buildtools

python pickle
1个回答
0
投票
PyPI 上的

pickle5 页面表示它“向后移植 Python 3.8.3 中 pickle 模块中添加的所有功能和 API”并且“应该与 Python 3.5、3.6 和 3.7 配合使用”;但是,您尝试在 Python 3.11 上安装它

我认为你应该使用内置的

pickle
模块。

© www.soinside.com 2019 - 2024. All rights reserved.