gpt4 book ai didi

python - 导入错误: cannot import name redirect_stderr

转载 作者:行者123 更新时间:2023-12-01 07:15:08 27 4
gpt4 key购买 nike

我认为这在某种程度上与安装的Python有关,但我不知道如何修复它。

这就是我所拥有的:

$ python --version
Python 2.7.12

$ pyftsubset
Traceback (most recent call last):
File "/usr/local/bin/pyftsubset", line 7, in <module>
from fontTools.subset import main
File "/usr/local/lib/python2.7/dist-packages/fontTools/__init__.py", line 1, in <module>
from fontTools.misc.py23 import *
File "/usr/local/lib/python2.7/dist-packages/fontTools/misc/__init__.py", line 3, in <module>
from fontTools.misc.py23 import *
File "/usr/local/lib/python2.7/dist-packages/fontTools/misc/py23.py", line 6, in <module>
from contextlib import redirect_stderr, redirect_stdout
ImportError: cannot import name redirect_stderr

最佳答案

您需要卸载fontTools,然后安装py27它的分支。您使用的版本不向后兼容 Python 2.7

关于python - 导入错误: cannot import name redirect_stderr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58014172/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com