xontrib-powerline icon indicating copy to clipboard operation
xontrib-powerline copied to clipboard

NameError: name '__xonsh_env__' is not defined

Open wmayner opened this issue 4 years ago • 2 comments

When I run xontrib load powerline I get NameError: name '__xonsh_env__' is not defined. I'm new to xonsh so it might be an issue on my end, but I'm not sure how to debug this.

xonfig:

+------------------+----------------------+
| xonsh            | 0.9.11               |
| Git SHA          | dd16d59d             |
| Commit Date      | Aug 25 13:21:16 2019 |
| Python           | 3.7.4                |
| PLY              | 3.11                 |
| have readline    | True                 |
| prompt toolkit   | None                 |
| shell type       | readline             |
| pygments         | None                 |
| on posix         | True                 |
| on linux         | False                |
| on darwin        | True                 |
| on windows       | False                |
| on cygwin        | False                |
| on msys2         | False                |
| is superuser     | False                |
| default encoding | utf-8                |
| xonsh encoding   | utf-8                |
| encoding errors  | surrogateescape      |
+------------------+----------------------+

Traceback:

Traceback (most recent call last):
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 15263, in wait
    r = self.f(self.args, stdin, stdout, stderr, spec, spec.stack)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 14758, in proxy_two
    return f(args, stdin)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 12176, in xontribs_main
    return _MAIN_XONTRIB_ACTIONS[ns.action](ns)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 12096, in _load
    xontribs_load(ns.names, verbose=ns.verbose)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 12088, in xontribs_load
    update_context(name, ctx=ctx)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 12037, in update_context
    modctx = xontrib_context(name)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xonsh/__amalgam__.py", line 12001, in xontrib_context
    m = importlib.import_module(spec.name)
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xontrib/powerline.xsh", line 223, in <module>
    pl_build_prompt()
  File "/Users/will/.virtualenvs/xonsh/lib/python3.7/site-packages/xontrib/powerline.xsh", line 213, in pl_build_prompt
    if varname not in __xonsh_env__:
NameError: name '__xonsh_env__' is not defined

wmayner avatar Aug 30 '19 18:08 wmayner