How to Install six in Python
Python 2 and 3 compatibility utilities
pip install six
What is six?
Python 2 and 3 compatibility utilities
Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions. See the documentation for more information on what is provided.
Six supports Python 2.7 and 3.3+. It is contained in only one Python file, so it can be easily copied into your project. (The copyright and license notice must be retained.)
Bugs can be reported to The code can also be found there.
Quick Start
Minimal example to get started with six:
import six
print(six.__version__)
Installation
pip (standard)
pip install six
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install six
pip3
pip3 install six
conda
conda install -c conda-forge six
Poetry
poetry add six
Verify the Installation
After installing, confirm the package is available:
python -c "import six; print(six.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing six with pip.
ModuleNotFoundError: No module named 'six'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install six. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'six' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install six to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'six'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show six and upgrade with pip install --upgrade six.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install six. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user six
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org six
Recent Releases
| Version | Released |
|---|---|
1.17.0 latest |
2024-12-04 |
1.16.0 |
2021-05-05 |
1.15.0 |
2020-05-21 |
1.14.0 |
2020-01-15 |
1.13.0 |
2019-11-05 |
Manage six
Upgrade to latest version
pip install --upgrade six
Install a specific version
pip install six==1.17.0
Uninstall
pip uninstall six
Check what is installed
pip show six