gtaylor / python-colormath

A python module that abstracts common color math operations. For example, converting from CIE L*a*b to XYZ, or from RGB to CMYK
python-colormath.readthedocs.org
BSD 3-Clause "New" or "Revised" License
456 stars 82 forks source link

Error when importing color_conversions module #78

Closed RolandMunsil closed 6 years ago

RolandMunsil commented 6 years ago

Using colormath 2.1.1, python 3.6.2. When I try to import convert_color I get the following error:

Traceback (most recent call last):
  File "[removed]", line 2, in <module>
    from colormath.color_conversions import convert_color
  File "C:\Program Files\Python36\lib\site-packages\colormath\color_conversions.py", line 167, in <module>
    def Spectral_to_XYZ(cobj, illuminant_override=None, *args, **kwargs):
  File "C:\Program Files\Python36\lib\site-packages\colormath\color_conversions.py", line 159, in decorator
    _conversion_manager.add_type_conversion(start_type, target_type, f)
  File "C:\Program Files\Python36\lib\site-packages\colormath\color_conversions.py", line 125, in add_type_conversion
    self.conversion_graph.add_edge(start_type, target_type, {'conversion_function': conversion_function})
TypeError: add_edge() takes 3 positional arguments but 4 were given
Press any key to continue . . .

To reproduce all you need is a python file with one line: from colormath.color_conversions import convert_color.

Azd325 commented 6 years ago

You have to downgrade networkx to >2.0 for colormath 2.1 because the requirements are to too loosely defined in the setup.py

RolandMunsil commented 6 years ago

Did you mean <2.0? Or do I have to upgrade to the dev version of networkx (2.1)?

Azd325 commented 6 years ago

Yes, I mean <2.0 :) The have only to release the latest version to pypi, then it will work again.

RolandMunsil commented 6 years ago

Alright, downgraded to 1.11 and now it's working perfectly. Thanks for your help!