Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name '__xonsh_env__' is not defined #25

Open
wmayner opened this issue Aug 30, 2019 · 2 comments
Open

NameError: name '__xonsh_env__' is not defined #25

wmayner opened this issue Aug 30, 2019 · 2 comments

Comments

@wmayner
Copy link

wmayner commented Aug 30, 2019

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
@mogenson
Copy link

mogenson commented Sep 9, 2019

Looks like the pip version hasn't been updated since 2017. The master branch of this repo works fine with xonsh 0.9. @santagada, would you mind pushing a new version to PyPI?

@micimize
Copy link

There's a working fork here: https://pypi.org/project/xontrib-powerline2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants