99designs / colorific

Automatic color palette detection
ISC License
700 stars 55 forks source link

ImportError: cannot import name RGBColor #18

Closed streiten closed 10 years ago

streiten commented 10 years ago

Is it pyhton-newbie-me missing something for this error ? any help/pointers much appriciated! thx Alex

Its running on debian 6.0 after adding python 2.7 in a virtualenv and says:

webadmin@wartegarten:~/colorific-sandbox$ ./bin/colorific Traceback (most recent call last): File "./bin/colorific", line 9, in load_entry_point('colorific==0.2.1', 'console_scripts', 'colorific')() File "/home/webadmin/colorific-sandbox/lib/python2.7/site-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/home/webadmin/colorific-sandbox/lib/python2.7/site-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/home/webadmin/colorific-sandbox/lib/python2.7/site-packages/pkg_resources.py", line 2088, in load entry = import(self.module_name, globals(),globals(), ['name']) File "/home/webadmin/colorific-sandbox/lib/python2.7/site-packages/colorific.py", line 21, in from colormath.color_objects import RGBColor ImportError: cannot import name RGBColor

harto commented 10 years ago

Confirmed; I get the same result.

larsyencken commented 10 years ago

I can replicate it too. I believe it's due to upstream changes in colormath, issue https://github.com/99designs/colorific/issues/17

I just put out a new release 0.2.2 where we pin colormath to a known good version. Using this version fixes the problem for me. Please give it a try, and reopen this issue if you have any problems.

larsyencken commented 10 years ago

Hi Martin,

How have you installed colorific? If you install it with pip, it should actually uninstall colormath 2.0.2 and install 1.0.9 in its place.

Alternatively, try installing it into a virtualenv sandbox and see if gets the right version of colormath there.

virtualenv env env/bin/pip install colorific

Hope that helps!

On Sat, May 31, 2014 at 12:59 AM, Martin Samson notifications@github.com wrote:

Getting the same error on colorific 0.2.2:

from colorific import palette Traceback (most recent call last): File "", line 1, in File "/Users/martin/dev/cp/venvs/colorific/lib/python2.7/site-packages/colorific/palette.py", line 16, in from colormath.color_objects import RGBColor ImportError: cannot import name RGBColor import colormath dir(colormath) ['VERSION', 'builtins', 'doc', 'file', 'name', 'package', 'path', 'chromatic_adaptation', 'color_constants', 'color_exceptions', 'color_objects', 'density', 'density_standards'] colormath.VERSION '2.0.2' dir(colormath.color_objects) ['AdobeRGBColor', 'BaseRGBColor', 'CMYColor', 'CMYKColor', 'ColorBase', 'HSLColor', 'HSVColor', 'IlluminantMixin', 'InvalidIlluminantError', 'InvalidObserverError', 'LCHabColor', 'LCHuvColor', 'LabColor', 'LuvColor', 'SpectralColor', 'XYZColor', 'builtins', 'doc', 'file', 'name', 'package', 'apply_chromatic_adaptation_on_color', 'color_constants', 'density', 'logger', 'logging', 'math', 'numpy', 'sRGBColor', 'xyYColor']

— Reply to this email directly or view it on GitHub https://github.com/99designs/colorific/issues/18#issuecomment-44660429.

masom commented 10 years ago

Hello Lars,

I quickly realized colormath was installed as 2.0.2 and pip install -U -r requirements.txt didn't remove it.

Once colormath was re-installed everything worked fine.

Thanks for this awesome little library!

larsyencken commented 10 years ago

No worries, glad you're enjoying it. Happy coding!