本文介绍了pyclipper安装错误:"tp_print不是_typeobject的成员"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在尝试安装pyclipper与nototools一起使用. https://github.com/googlefonts/nototools 但我无法安装pyclipper.我认为Visual Studio buildtools中有一些东西.

I'm trying to install pyclipper to use with nototools. https://github.com/googlefonts/nototools But I can't get pyclipper installed. I think there is something with Visual Studio buildtools.

Collecting pyclipper==1.1.0.post1
  Using cached pyclipper-1.1.0.post1.zip (135 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pyclipper
  Building wheel for pyclipper (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\phuwi\appdata\local\programs\python\python39\python.exe' 'c:\users\phuwi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\phuwi\AppData\Local\Temp\tmpwa7t8eac'
       cwd: C:\Users\phuwi\AppData\Local\Temp\pip-install-ejg_l8me\pyclipper_be85d240fbf84e1388f6c535a16010eb
  Complete output (26 lines):
  Distribution mode: Compiling Cython generated .cpp sources.
  running bdist_wheel
  running build
  running build_ext
  building 'pyclipper' extension
  creating build
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\pyclipper
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\phuwi\appdata\local\programs\python\python39\include -Ic:\users\phuwi\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tppyclipper/clipper.cpp /Fobuild\temp.win-amd64-3.9\Release\pyclipper/clipper.obj
  clipper.cpp
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\phuwi\appdata\local\programs\python\python39\include -Ic:\users\phuwi\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /EHsc /Tppyclipper/pyclipper.cpp /Fobuild\temp.win-amd64-3.9\Release\pyclipper/pyclipper.obj
  pyclipper.cpp
  pyclipper/pyclipper.cpp(7938): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
  pyclipper/pyclipper.cpp(8068): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
  pyclipper/pyclipper.cpp(9405): error C2039: 'tp_print': is not a member of '_typeobject'
  c:\users\phuwi\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(9413): error C2039: 'tp_print': is not a member of '_typeobject'
  c:\users\phuwi\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(9421): error C2039: 'tp_print': is not a member of '_typeobject'
  c:\users\phuwi\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(9427): error C2039: 'tp_print': is not a member of '_typeobject'
  c:\users\phuwi\appdata\local\programs\python\python39\include\cpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(10553): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
  pyclipper/pyclipper.cpp(10569): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for pyclipper
Failed to build pyclipper
ERROR: Could not build wheels for pyclipper which use PEP 517 and cannot be installed directly ```

推荐答案

tp_print 方法已从Python 3.9的API中删除.错误"'tp_print':不是'_typeobject''的成员;表示该代码适用于python< = 3.8.

The tp_print method was removed from the API in Python 3.9. Error "'tp_print': is not a member of '_typeobject'" means that the code is intended for Python <= 3.8.

降级到Python 3.8,然后重试.

Downgrade to Python 3.8 and try again.

更新. pyclipper 只是发布了1.2.1版,其中适用于Python 3.9的轮子.

Upd. pyclipper just released version 1.2.1 with wheels for Python 3.9.

PS.永远不要着急使用较新的主要Python版本,请等到所有第三方库都适应之后.

PS. Never hurry to a newer major version of Python, wait until all your 3rd-party libraries adapt.

这篇关于pyclipper安装错误:"tp_print不是_typeobject的成员"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 10:25