问题描述
我正在尝试安装 pyclipper 以与 nototools 一起使用.https://github.com/googlefonts/nototools 但我无法安装 pyclipper.我认为 Visual Studio 构建工具有一些东西.
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:UsersphuwiAppDataLocalTemp mpwa7t8eac'
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 build emp.win-amd64-3.9
creating build emp.win-amd64-3.9Release
creating build emp.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 /Fobuild emp.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 /Fobuild emp.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 ```
推荐答案
tp_print
方法已从 Python 3.9 的 API 中删除.错误'tp_print':不是'_typeobject'的成员";表示该代码适用于 Python
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.
附注.不要急于使用更新的 Python 主要版本,等到所有 3rd 方库都适应后再使用.
PS. Never hurry to a newer major version of Python, wait until all your 3rd-party libraries adapt.
这篇关于pyclipper 安装错误:“tp_print 不是 _typeobject 的成员";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!