colour icon indicating copy to clipboard operation
colour copied to clipboard

can not import Colour from colour (unknown location)

Open dtbulmerJRs opened this issue 5 years ago • 3 comments

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?

dtbulmerJRs avatar Dec 22 '19 04:12 dtbulmerJRs

Use from colour import Color. ~Colour~Color

shvms avatar Apr 08 '20 20:04 shvms

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 avatar Aug 02 '22 18:08 hop-soellingeraj

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.

hop-soellingeraj avatar Aug 02 '22 18:08 hop-soellingeraj