最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How do I fix this pyenet installation error? - Stack Overflow

programmeradmin2浏览0评论
  1. I tried installing pyenet in PowerShell:
PS C:\Users\lbonc> py -m pip install pyenet
Collecting pyenet
  Using cached pyenet-1.3.17.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting Cython<1,>=0 (from pyenet)
  Using cached Cython-0.29.37-py2.py3-none-any.whl.metadata (3.1 kB)
Using cached Cython-0.29.37-py2.py3-none-any.whl (989 kB)
Building wheels for collected packages: pyenet
  Building wheel for pyenet (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyenet (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      running build
      running build_ext
      Compiling enet.pyx because it changed.
      [1/1] Cythonizing enet.pyx
      building 'enet' extension
      creating build\temp.win-amd64-cpython-313\Release
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAS_POLL -DHAS_FCNTL -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T -DWIN32 -DHAS_GETHOSTBYNAME_R -DHAS_GETHOSTBYADDR_R -Ienet/include/ -IC:\Users\lbonc\AppData\Local\Programs\Python\Python313\include -IC:\Users\lbonc\AppData\Local\Programs\Python\Python313\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\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" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcenet.c /Fobuild\temp.win-amd64-cpython-313\Release\enet.obj
      enet.c
      enet.c(887): warning C4996: 'Py_UNICODE': deprecated in 3.13
      enet.c(888): warning C4996: 'Py_UNICODE': deprecated in 3.13
      enet.c(20392): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(20740): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(20936): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21170): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21366): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21600): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21834): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(22030): error C2198: '_PyLong_AsByteArray': too few arguments for call
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\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 pyenet
Failed to build pyenet
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyenet)

What does this error mean? I have literally no clue what to do to fix this error. Can someone please break down this error for me to understand?

  1. I tried installing pyenet in PowerShell:
PS C:\Users\lbonc> py -m pip install pyenet
Collecting pyenet
  Using cached pyenet-1.3.17.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting Cython<1,>=0 (from pyenet)
  Using cached Cython-0.29.37-py2.py3-none-any.whl.metadata (3.1 kB)
Using cached Cython-0.29.37-py2.py3-none-any.whl (989 kB)
Building wheels for collected packages: pyenet
  Building wheel for pyenet (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyenet (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      running bdist_wheel
      running build
      running build_ext
      Compiling enet.pyx because it changed.
      [1/1] Cythonizing enet.pyx
      building 'enet' extension
      creating build\temp.win-amd64-cpython-313\Release
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAS_POLL -DHAS_FCNTL -DHAS_MSGHDR_FLAGS -DHAS_SOCKLEN_T -DWIN32 -DHAS_GETHOSTBYNAME_R -DHAS_GETHOSTBYADDR_R -Ienet/include/ -IC:\Users\lbonc\AppData\Local\Programs\Python\Python313\include -IC:\Users\lbonc\AppData\Local\Programs\Python\Python313\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\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" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcenet.c /Fobuild\temp.win-amd64-cpython-313\Release\enet.obj
      enet.c
      enet.c(887): warning C4996: 'Py_UNICODE': deprecated in 3.13
      enet.c(888): warning C4996: 'Py_UNICODE': deprecated in 3.13
      enet.c(20392): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(20740): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(20936): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21170): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21366): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21600): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(21834): error C2198: '_PyLong_AsByteArray': too few arguments for call
      enet.c(22030): error C2198: '_PyLong_AsByteArray': too few arguments for call
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.35.32215\\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 pyenet
Failed to build pyenet
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyenet)

What does this error mean? I have literally no clue what to do to fix this error. Can someone please break down this error for me to understand?

Share Improve this question edited Feb 15 at 12:44 toyota Supra 4,5458 gold badges21 silver badges24 bronze badges asked Feb 15 at 10:52 ShinesShines 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

First you are being warned that Py_UNICODE is deprecated, so a pretty likely possibility is that you mix up a new version of Python with an old library which are no longer compatible.

enet.c(20392): error C2198: '_PyLong_AsByteArray': too few arguments for call

tells you that _PyLong_AsByteArray is a function, which is to convert a Long to a Byte array, but when it's called, the number of arguments that are passed to it are fewer than the number of arguments it expects. The function was removed from Python, see this PR: https://github/python/cpython/pull/108429

https://github/python/cpython/pull/108429/files

This was the declaration of this function:

PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
    unsigned char* bytes, size_t n,
    int little_endian, int is_signed);

now, check the source-code if you have it and find calls for this function, knowing that

The replacement for _PyLong_AsByteArray() is PyObject_CallMethod(my_int, "to_bytes", "ns", length, "big")

see: https://github/python/cpython/issues/111140

发布评论

评论列表(0)

  1. 暂无评论