bpython is a lightweight Python interpreter that provides a fancy curses-based interface to the standard Python REPL. It enhances the interactive experience with features such as syntax highlighting, expected parameter lists, auto-indentation, and autocompletion. It also includes unique functionalities like 'rewind' (undoing the last line), code pastebin, and in-editor session editing. The library is actively maintained, with version 0.26 being the latest release, and new versions often focus on supporting the latest Python releases.
pip install bpythonVerified import paths — ran on the pinned version, not inferred.
While bpython is most commonly started by typing `bpython` in the terminal, you can also embed it programmatically within your Python scripts. This allows you to drop into an interactive bpython session at a specific point in your code, with access to local variables, useful for debugging or interactive exploration.
Upgrade Python to 3.10+ or downgrade bpython to 0.25 or earlier for Python 3.9 compatibility.
Migrate to the default `curses` backend or the deprecated `urwid` backend if necessary.
Upgrade to Python 3 (preferably 3.10+ for current bpython versions).
Upgrade Python to 3.10+ or downgrade bpython to 0.24 or earlier for Python 3.7/3.8 compatibility.
Run `pip install pyperclip` in your environment.
Upgrade to bpython 0.22 or newer to ensure `embed()` correctly respects the `locals` argument. (Fixed in #841 and released in 0.22).
Ensure a sufficiently new version of the 'six' package is available in your Python environment. On macOS with Python 2.7, adding `export PYTHONPATH=/Library/Python/2.7/site-packages/:$PYTHONPATH` to your `~/.bashrc` or `~/.zshrc` can help resolve the `sys.path` issue. Upgrading your Python version is also recommended.
Manually install the missing dependencies: `pip install pyOpenSSL pyasn1 ndg-httpsclient`. Upgrading your Python installation to 2.7.7 or newer is also recommended to avoid this issue.
Upgrade your Python installation to version 2.7.7 or newer, and ensure 'pyOpenSSL', 'pyasn1', and 'ndg-httpsclient' are installed to provide necessary SSL/TLS capabilities.
On Windows, bpython's full functionality may be limited. While 'pyreadline3' can provide 'readline'-like features for general Python, bpython on Windows often requires specific workarounds. Install `windows-curses` (`pip install windows-curses`) and run `bpython-curses` instead of `bpython` from your terminal.
This was an internal bug in older bpython versions. The primary fix is to ensure you are using the latest version of bpython (0.26) as such issues are typically resolved in newer releases.