memeplex/base16-prompt-toolkit

ModuleNotFoundError: No module named 'prompt_toolkit.terminal

gbishop opened this issue · 2 comments

I'm trying to get control of colors on my ipython prompt so I gave this a try. But it fails with a complaint about a missing module. Any ideas on what is going wrong?

MT1$ ipython [TerminalIPythonApp] ERROR | Exception while loading config file /home/gb/.ipython/profile_default/ipython_config.py Traceback (most recent call last): File "/home/gb/miniconda3/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files config = loader.load_config() File "/home/gb/miniconda3/envs/jupyter/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config self._read_file_as_dict() File "/home/gb/miniconda3/envs/jupyter/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict py3compat.execfile(conf_filename, namespace) File "/home/gb/miniconda3/envs/jupyter/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile exec(compiler(f.read(), fname, 'exec'), glob, loc) File "/home/gb/.ipython/profile_default/ipython_config.py", line 311, in <module> theme = importlib.import_module('base16.base16-monokai') File "/home/gb/miniconda3/envs/jupyter/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/gb/python/extensions/base16/base16-monokai.py", line 7, in <module> from prompt_toolkit.terminal.vt100_output import _256_colors ModuleNotFoundError: No module named 'prompt_toolkit.terminal' Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:53:17)

Changing line 7 in base16/base16-monokai.py to

from prompt_toolkit.output.vt100 import _256_colors

Seems to fix it.

Fixed in #5