{"id":21206,"library":"eight","title":"eight - Python 2/3 porting helper","description":"A lightweight porting helper library for writing Python 2/3 compatible code. Current version 1.0.1, stable and maintained as needed.","status":"maintenance","version":"1.0.1","language":"python","source_language":"en","source_url":"https://github.com/kislyuk/eight","tags":["porting","python2","python3","compatibility"],"install":[{"cmd":"pip install eight","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for Python 2/3 compatibility utilities","package":"future","optional":false}],"imports":[{"note":"eight provides its own str from builtins via future","wrong":"from six import text_type","symbol":"str","correct":"from builtins import str"},{"note":"","wrong":"","symbol":"int","correct":"from builtins import int"},{"note":"Prefer using str for both versions","wrong":"","symbol":"unicode","correct":"for Python 2 compatibility: from builtins import str (eight unicode is str)"}],"quickstart":{"code":"from future.builtins import *\nfrom eight import *\n# Now you can write Python 3 code that works on Python 2\nprint(str('hello'))","lang":"python","description":"Import future and eight for Python 2/3 compatible builtins."},"warnings":[{"fix":"Use 'from future.utils import with_metaclass' or import dummy_thread directly if needed.","message":"eight v1.0.1 removed the deprecated 'dummy_thread' symbol from Python 2's dummy_thread module.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Run: pip install 'future>=0.16'","message":"eight relies on the 'future' library. Ensure future is installed and up-to-date (>=0.16) to avoid import errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Stick to one compatibility library.","message":"Do not mix 'six' and 'eight' imports. They may conflict.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install future","cause":"future package not installed or not in path.","error":"ImportError: No module named builtins"},{"fix":"Use: from eight import str","cause":"Incorrect import of future.builtins instead of using eight's imports.","error":"AttributeError: module 'future.builtins' has no attribute 'str'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}