The webcolors module has no external dependencies other than Python itself. It’s officially tested and supported on the following versions of Python:
- Python 2.7
- Python 3.3
- Python 3.4
- Python 3.5
It is expected that webcolors 1.7 will work without modification on Python 3.6 once it is released.
Although webcolors is supported on Python 3.3 and later, it is not and will not be supported on earlier Python 3.x releases. Python 3.3 was the first 3.x release to include several important Python 2/3 compatibility features, which allow webcolors to support Python 2 and 3 in the same codebase.
The preferred method of installing webcolors is via
standard Python package-installation tool. If you don’t have
instructions are available for how to obtain and install it. If you’re using
Python 2.7.9 or later (for Python 2) or Python 3.4 or later (for
pip came bundled with your installation of Python.
Once you have
pip, simply type:
pip install webcolors
It’s also possible to install webcolors manually. To do so, obtain
the latest packaged version from the listing on the Python Package
Index. Unpack the
.tar.gz file, and run:
python setup.py install
Once you’ve installed webcolors, you can verify successful
installation by opening a Python interpreter and typing
If the installation was successful, you’ll simply get a fresh Python
prompt. If you instead see an
ImportError, check the configuration
of your install tools and your Python import path to ensure
webcolors installed into a location Python can import from.
Installing from a source checkout¶
git clone https://github.com/ubernostrum/webcolors.git
From there, you can use normal git commands to check out the specific
revision you want, and install it using
python setup.py install.