vaab / colour

Python color representations manipulation library (RGB, HSL, web, ...)
BSD 2-Clause "Simplified" License
319 stars 41 forks source link

can not import Colour from colour (unknown location) #52

Open dtbulmerJRs opened 4 years ago

dtbulmerJRs commented 4 years ago

I can not import the most basic class and that is Color

from colour import Color Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'Color' from 'colour' (unknown location)

this is in python3, and I am trying to run manim python code. How can I fix this?

shvms commented 4 years ago

Use from colour import Color. ~Colour~Color

hop-soellingeraj commented 2 years ago

This doesn't work in the packages install with the following commands:

$ python3.8 -m pip install colour
$ python3.8 -m pip install git+https://github.com/vaab/colour@master
$ python3.8 -m pip install git+https://github.com/vaab/colour

Only after I cloned and installed from master did it work.

$ git clone https://github.com/vaab/colour.git
$ cd colour
$ python3.8 -m pip install -e .

then I could

$ python3.8 
Python 3.8.11 (default, Jul 29 2021, 14:57:32) 
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from colour import Color
>>> exit()

Curiously, they all have the same package version ==0.1.5

hop-soellingeraj commented 2 years ago

Actually, scratch that. The only reason that it worked was because I was cd'd into the colour/ directory and thus the Color.py module was in my Path. I think that the project structure must have gotten messed up somehow.