Powerline: Problem with ipython3

Created on 28 Jul 2017  ·  12Comments  ·  Source: powerline/powerline

  File "/usr/lib/python3.6/site-packages/powerline/bindings/ipython/since_5.py", line 11, in <module>
    from powerline.bindings.ipython.post_0_11 import PowerlineMagics, ShutdownHook
ModuleNotFoundError: No module named 'powerline.bindings.ipython.post_0_11'

EDIT: Replaced single backticks with 4-space indent.

cipython bug

All 12 comments

What iPython version? And do not use single backticks for code blocks, there are lots of alternatives which do keep newlines: <pre>, triple backticks (on their own lines), 4-space indent.

IPython 5.3.0 with Python 3.6.2 gives the error while IPython 5.3.0 with Python 2.7.13 works.

EDIT:

$ ls /usr/lib/python3.6/site-packages/powerline/bindings/ipython
__init__.py  __pycache__  since_5.py

$ ls /usr/lib/python2.7/site-packages/powerline/bindings/ipython
__init__.py  __init__.pyc  post_0_11.py  post_0_11.pyc  pre_0_11.py  pre_0_11.pyc  since_5.py  since_5.pyc

@qoheniac It looks like you have broken installation, you need to reinstall powerline: setup.py does not alter installed file sets depending on Python version.

I am having the same issue on Fedora 26.
Using powerline from the official repositories.

Tried a sudo dnf reinstall powerline to no avail.
powerline works perfectly with zsh, vim, tmux just not with ipython/ipython3.

System details

Contents of ~/.ipython/profile_default/ipython_config.py:

from powerline.bindings.ipython.since_5 import PowerlinePrompts
c = get_config()
c.TerminalInteractiveShell.simple_prompt = False
c.TerminalInteractiveShell.prompts_class = PowerlinePrompts

ipython3:

[TerminalIPythonApp] ERROR | Exception while loading config file /home/aairey/.ipython/profile_default/ipython_config.py
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
    config = loader.load_config()
  File "/usr/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
    self._read_file_as_dict()
  File "/usr/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
    py3compat.execfile(conf_filename, namespace)
  File "/usr/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 185, in execfile
    exec(compiler(f.read(), fname, 'exec'), glob, loc)
  File "/home/aairey/.ipython/profile_default/ipython_config.py", line 1, in <module>
    from powerline.bindings.ipython.since_5 import PowerlinePrompts
  File "/usr/lib/python3.6/site-packages/powerline/bindings/ipython/since_5.py", line 11, in <module>
    from powerline.bindings.ipython.post_0_11 import PowerlineMagics, ShutdownHook
ModuleNotFoundError: No module named 'powerline.bindings.ipython.post_0_11'
Python 3.6.2 (default, Jul 19 2017, 13:09:21) 
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:                     

ipython:

[TerminalIPythonApp] ERROR | Exception while loading config file /home/aairey/.ipython/profile_default/ipython_config.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/traitlets/config/application.py", line 562, in _load_config_files
    config = loader.load_config()
  File "/usr/lib/python2.7/site-packages/traitlets/config/loader.py", line 457, in load_config
    self._read_file_as_dict()
  File "/usr/lib/python2.7/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
    py3compat.execfile(conf_filename, namespace)
  File "/usr/lib/python2.7/site-packages/ipython_genutils/py3compat.py", line 288, in execfile
    builtin_mod.execfile(filename, *where)
  File "/home/aairey/.ipython/profile_default/ipython_config.py", line 1, in <module>
    from powerline.bindings.ipython.since_5 import PowerlinePrompts
ImportError: No module named powerline.bindings.ipython.since_5
Python 2.7.13 (default, Jun 26 2017, 10:20:05) 
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: 

Other details:

$ ls /usr/lib/python3.6/site-packages/powerline/bindings/ipython

$ ls /usr/lib/python2.7/site-packages/powerline
ls: cannot access '/usr/lib/python2.7/site-packages/powerline': No such file or directory

$ dnf info powerline
Installed Packages
Name         : powerline
Version      : 2.6
Release      : 2.fc26
Arch         : x86_64
Size         : 1.7 M
Source       : powerline-2.6-2.fc26.src.rpm
Repo         : @System
From repo    : updates
Summary      : The ultimate status-line/prompt utility
URL          : https://github.com/powerline/powerline
License      : MIT
Description  : Powerline is a status-line plugin for vim, and provides status-lines and prompts
             : for several other applications, including zsh, bash, tmux, IPython, Awesome and
             : Qtile.

@aairey This needs to be directed by package maintainer, I do not know why dnf is not installing files which are present in the repository (and what is “dnf” in first place except that this should be some fedora package manager based on your comment). In this issue tracker only pip package is maintained.

Thanks Nikolai, will contact the maintainer.

FWIW: DNF is YUM's successor.

On Sat, 2 Sep 2017 at 23:34 Nikolai Aleksandrovich Pavlov <
[email protected]> wrote:

Closed #1810 https://github.com/powerline/powerline/issues/1810.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/powerline/powerline/issues/1810#event-1232448130, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHSjviSXXyA_53lNYwgG1piF6fI-LHUsks5secn_gaJpZM4OmeKS
.

@aairey Did you hear anything from the maintainer yet?

For those using Fedora and powerline from the repositories. I don't know why but Fedora package maintainer move post_0_11.py somewhere else: https://src.fedoraproject.org/rpms/powerline/blob/master/f/powerline.spec#_147

You can fix it with this workaround:

sudo ln -s /usr/share/powerline/ipython/*.py /usr/lib/python3.6/site-packages/powerline/bindings/ipython/

We should create a bug report for this with Fedora, but was not able to yet.

Resolved here:

F28: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ad11252bde
F27: https://bodhi.fedoraproject.org/updates/FEDORA-2018-d6a558d13b

Testing working for me, please test and report back if you can

Tested on F27 and it works, thank you :-)

I have reported it here https://bodhi.fedoraproject.org/updates/FEDORA-2018-d6a558d13b should i do something else?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dylon picture dylon  ·  41Comments

mastrauckas picture mastrauckas  ·  33Comments

xfim picture xfim  ·  15Comments

nfarrar picture nfarrar  ·  11Comments

treyhunner picture treyhunner  ·  16Comments