-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Namespace clash with colour package. #958
Comments
Hi @mforbes, Yes this is a known issue, it is the first time though that someone reports it in almost 8 years! :) You will also note that the author of the So while there is no elegant solution, there is a dirty one that should hopefully work for you, i.e. namespace merging which is easy because python3 -m venv colour-science-colour
source colour-science-colour/bin/activate
pip install colour
mv colour-science-colour/lib/python3.9/site-packages/colour.py colour-science-colour/lib/python3.9/site-packages/color.py
pip install colour-science
echo "from color import *" >> colour-science-colour/lib/python3.9/site-packages/colour/__init__.py The steps run in a shell with output: Eris:Environments kelsolaar$ python3 -m venv colour-science-colour
Eris:Environments kelsolaar$ source colour-science-colour/bin/activate
(colour-science-colour) Eris:Environments kelsolaar$ pip install colour
Collecting colour
Using cached colour-0.1.5-py2.py3-none-any.whl (23 kB)
Installing collected packages: colour
Successfully installed colour-0.1.5
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/Users/kelsolaar/Documents/Development/Environments/colour-science-colour/bin/python3.9 -m pip install --upgrade pip' command.
(colour-science-colour) Eris:Environments kelsolaar$ mv colour-science-colour/lib/python3.9/site-packages/colour.py colour-science-colour/lib/python3.9/site-packages/color.py
(colour-science-colour) Eris:Environments kelsolaar$ pip install colour-science
Collecting colour-science
Using cached colour_science-0.4.1-py3-none-any.whl (2.2 MB)
Collecting imageio<3,>=2
Using cached imageio-2.16.1-py3-none-any.whl (3.3 MB)
Collecting numpy<2,>=1.19
Using cached numpy-1.22.3-cp39-cp39-macosx_11_0_arm64.whl (12.8 MB)
Collecting scipy<2,>=1.5
Using cached scipy-1.8.0-cp39-cp39-macosx_12_0_arm64.whl (28.7 MB)
Collecting typing-extensions<5,>=4
Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting pillow>=8.3.2
Using cached Pillow-9.0.1-1-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB)
Installing collected packages: pillow, numpy, typing-extensions, scipy, imageio, colour-science
Successfully installed colour-science-0.4.1 imageio-2.16.1 numpy-1.22.3 pillow-9.0.1 scipy-1.8.0 typing-extensions-4.1.1
WARNING: You are using pip version 21.3.1; however, version 22.0.4 is available.
You should consider upgrading via the '/Users/kelsolaar/Documents/Development/Environments/colour-science-colour/bin/python3.9 -m pip install --upgrade pip' command.
(colour-science-colour) Eris:Environments kelsolaar$ echo "from color import *" >> colour-science-colour/lib/python3.9/site-packages/colour/__init__.py
(colour-science-colour) Eris:Environments kelsolaar$ python
Python 3.9.9 (main, Nov 21 2021, 03:16:13)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import colour
>>> colour.Color
<class 'color.Color'>
>>> colour.utilities.describe_environment()
===============================================================================
* *
* Interpreter : *
* python : 3.9.9 (main, Nov 21 2021, 03:16:13) *
* [Clang 13.0.0 (clang-1300.0.29.3)] *
* *
* colour-science.org : *
* colour : 0.4.1 *
* *
* Runtime : *
* imageio : 2.16.1 *
* numpy : 1.22.3 *
* scipy : 1.8.0 *
* *
===============================================================================
defaultdict(<class 'dict'>, {'Interpreter': {'python': '3.9.9 (main, Nov 21 2021, 03:16:13) \n[Clang 13.0.0 (clang-1300.0.29.3)]'}, 'colour-science.org': {'colour': '0.4.1'}, 'Runtime': {'imageio': '2.16.1', 'numpy': '1.22.3', 'scipy': '1.8.0'}}) |
@KelSolaar Thanks for the suggestion. Any idea how I tell Poetry or Anaconda Project to do this? They don't currently allow hooks. Would it be possible to have a |
Mmmh, I don't think it is possible unfortunately! |
I will close this one as there is not much we can do about it! |
Description
The
colour
namespace used by this package collides with thecolour
package. Usually this is not a problem when packages have the same name as their project namespace (since these must be unique on PyPI) but since this project uses the namecolour-science
, the usual collision avoidance does not work.Is there a way to configure colour-science to coexist with the
colour
package?My actual issue is that I am using
manim
which depends oncolour
, so the solution suggested on stack overflow will not work unless I modifymanim
.Code for Reproduction
Exception Message
Environment Information
The text was updated successfully, but these errors were encountered: