ImportError: cannot import name 'RGBColor'
ImportError: cannot import name 'RGBColor'
我正在尝试导入这个:
from colormath.color_objects import RGBColor
我收到这个错误:
ImportError: cannot import name 'RGBColor'
我正在使用 Python 3.6 并安装了库 colormath。
RGBColor
是从旧版本的 colormath 中删除的 class。
来自 v2.0.1 release notes (2014):
Completely re-worked RGB handling. Each RGB space now has its own
class, inheriting from BaseRGBColor. Consequently, RGBColor is no
more. In most cases, you can substitute RGBColor with sRGBColor during
your upgrade.
如果您查看 current documentation,您会发现确实没有 RGBColor
。请尝试 sRGBColor
。
我正在尝试导入这个:
from colormath.color_objects import RGBColor
我收到这个错误:
ImportError: cannot import name 'RGBColor'
我正在使用 Python 3.6 并安装了库 colormath。
RGBColor
是从旧版本的 colormath 中删除的 class。
来自 v2.0.1 release notes (2014):
Completely re-worked RGB handling. Each RGB space now has its own class, inheriting from BaseRGBColor. Consequently, RGBColor is no more. In most cases, you can substitute RGBColor with sRGBColor during your upgrade.
如果您查看 current documentation,您会发现确实没有 RGBColor
。请尝试 sRGBColor
。