Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
203 views
in Technique[技术] by (71.8m points)

python - pyclipper installation error: "tp_print is not a member of _typeobject"

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:usersphuwiappdatalocalprogramspythonpython39python.exe' 'c:usersphuwiappdatalocalprogramspythonpython39libsite-packagespip\_vendorpep517\_in_process.py' build_wheel 'C:UsersphuwiAppDataLocalTempmpwa7t8eac'
       cwd: C:UsersphuwiAppDataLocalTemppip-install-ejg_l8mepyclipper_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 buildemp.win-amd64-3.9
  creating buildemp.win-amd64-3.9Release
  creating buildemp.win-amd64-3.9Releasepyclipper
  C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333inHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:usersphuwiappdatalocalprogramspythonpython39include -Ic:usersphuwiappdatalocalprogramspythonpython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include -IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /EHsc /Tppyclipper/clipper.cpp /Fobuildemp.win-amd64-3.9Releasepyclipper/clipper.obj
  clipper.cpp
  C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333inHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:usersphuwiappdatalocalprogramspythonpython39include -Ic:usersphuwiappdatalocalprogramspythonpython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include -IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /EHsc /Tppyclipper/pyclipper.cpp /Fobuildemp.win-amd64-3.9Releasepyclipper/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:usersphuwiappdatalocalprogramspythonpython39includecpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(9413): error C2039: 'tp_print': is not a member of '_typeobject'
  c:usersphuwiappdatalocalprogramspythonpython39includecpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(9421): error C2039: 'tp_print': is not a member of '_typeobject'
  c:usersphuwiappdatalocalprogramspythonpython39includecpython/object.h(193): note: see declaration of '_typeobject'
  pyclipper/pyclipper.cpp(9427): error C2039: 'tp_print': is not a member of '_typeobject'
  c:usersphuwiappdatalocalprogramspythonpython39includecpython/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 ```
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

Downgrade to Python 3.8 and try again.

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...