jaspernbrouwer / powerline-gitstatus

A Powerline segment for showing the status of a Git working copy
MIT License
383 stars 52 forks source link

Powerline won't load #13

Closed askmrsinh closed 7 years ago

askmrsinh commented 8 years ago

Installed powerline-gitstatus following the instruction within the README.md file.

running powerline-lint gives

Error while checking segments (key /segments/right/list item 1/function)
  in "/home/ashesh/.config/powerline/themes/shell/default.json", line 34, column 42:
     ... function": "powerline_gitstatus.gitstatus",
                                         ^
failed to import module powerline_gitstatus
  in "/home/ashesh/.config/powerline/themes/shell/default.json", line 34, column 22:
            "function": "powerline_gitstatus.gitstatus",
jaspernbrouwer commented 8 years ago

Can you double-check if the color-scheme you use includes all the new groups this segment introduces? The readme gives default.json as an example, but maybe you're using a different one?

If that isn't the issue, could you set the log-level to DEBUG and see if that gives any additional info?

askmrsinh commented 7 years ago

I have double checked my colorschemes and themes json files. powerline-lint -d gives the same output. What else can I try?

jaspernbrouwer commented 7 years ago

Again, could you set the log-level to DEBUG and see if that gives any additional info? The log file should be appended with several entries on what the segment is doing. Seeing what it did last would help pinpointing the issue. And changes are there's an actual error-message in there 😉

askmrsinh commented 7 years ago

Sorry, I thought powerline-lint -d would be enough. Here's the output after setting logging level to DEBUG in the config.json file.

2016-10-08 04:17:44,269:DEBUG:tmux:watcher:Trying to use inotify watcher
2016-10-08 04:17:45,103:ERROR:shell:segment_generator:Failed to import attr gitstatus from module powerline_gitstatus: No module named 'powerline_gitstatus'
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/powerline/__init__.py", line 382, in get_module_attr
    return getattr(__import__(module, fromlist=(attr,)), attr)
ImportError: No module named 'powerline_gitstatus'
2016-10-08 04:17:45,104:ERROR:shell:segment_generator:Failed to generate segment from {'priority': 40, 'function': 'powerline_gitstatus.gitstatus'}: Failed to obtain segment function
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/powerline/segment.py", line 328, in get
    contents, _contents_func, module, function_name, name = get_segment_info(data, segment)
  File "/usr/lib/python3.5/site-packages/powerline/segment.py", line 69, in get_function
    raise ImportError('Failed to obtain segment function')
ImportError: Failed to obtain segment function
jaspernbrouwer commented 7 years ago

Ok, so the real error here is No module named 'powerline_gitstatus', which basically means Python cannot find the this package.

I see you're running Powerline on Python 3.5. Can you check if the directory /usr/lib/python3.5/site-packages/powerline_gitstatus exists?

If not, it's not correctly installed. Maybe you're running multiple versions of Python, and it's installed for another version?

smetj commented 7 years ago

Hi @user501254,

As @jaspernbrouwer mentioned you probably have multiple python environments installed. On Fedora24 I had to: pip3 install powerline_gitstatus

And add the the color scheme groups to: .config/powerline/colorschemes/solarized.json

askmrsinh commented 7 years ago

I had incorrect segment configuration, everything is working fine now. Thanks everyone :+1:

rneha725 commented 5 years ago

Hi @user501254,

As @jaspernbrouwer mentioned you probably have multiple python environments installed. On Fedora24 I had to: pip3 install powerline_gitstatus

And add the the color scheme groups to: .config/powerline/colorschemes/solarized.json

Thanks it worked!