You are not logged in.

#1 2020-12-03 17:54:06

AirsoftHamster
Member
Registered: 2020-11-10
Posts: 74

[SOLVED]Messed up something in my .bashrc, can't run commands anymore.

Error Message:

Traceback (most recent call last):
  File "/usr/bin/powerline-shell", line 5, in <module>
    from powerline_shell import main
ModuleNotFoundError: No module named 'powerline_shell'

Here is my .bashrc:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

# powerline
function _update_ps1() {
    PS1=$(powerline-shell $?)
}

if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
    PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi

# alias section
alias la="ls -la" # longhand list
alias clr="clear" # clear term
alias termconf="vim ~/.config/termite/config" # open termite config
alias bashconf="vim ~/.bashrc" # open the bash configuration

clear
neofetch

I was adding a couple aliases and I think I deleted something. I can't tell what is wrong though.

If I try the powerline script on the archwiki, I get weird boxes instead of the chevron lookign things.

Last edited by AirsoftHamster (2020-12-03 19:07:55)

Offline

#2 2020-12-03 18:11:21

AirsoftHamster
Member
Registered: 2020-11-10
Posts: 74

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

Contents of /usr/bin/powerline-shell:

#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from powerline_shell import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Offline

#3 2020-12-03 18:17:51

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

The error indicates that it can't find the python module named powerline_shell. Python was recently upgraded to version 3.9 so all python modules need to be rebuilt for the new version. AUR packages are your responsibility so you need to rebuild and re-install the powerline-shell package yourself.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2020-12-03 18:19:08

flyingscorpio
Member
Registered: 2020-06-04
Posts: 34

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

Are you sure this doesn't have anything to do with yesterday's Python update?
Where is your powerline-shell package installed?

EDIT: Xyne beat me

Last edited by flyingscorpio (2020-12-03 18:20:11)

Offline

#5 2020-12-03 18:31:14

AirsoftHamster
Member
Registered: 2020-11-10
Posts: 74

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

Upon running yay -S powerline powerline-shell, it errors out with the message:

error: failed to commit transaction (conflicting files)
powerline-shell: /usr/bin/powerline-shell exists in filesystem
Errors occurred, no packages were upgraded.

What should I do?

Offline

#6 2020-12-03 18:32:36

flyingscorpio
Member
Registered: 2020-06-04
Posts: 34

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

You need to force a rebuild

Offline

#7 2020-12-03 18:44:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,515
Website

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2020-12-03 18:50:05

AirsoftHamster
Member
Registered: 2020-11-10
Posts: 74

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

upon running pacman -Qo powerline-shell, no packages own it. I don't understand what I have to do from here.

EDIT: wait, I think I understand.

Last edited by AirsoftHamster (2020-12-03 18:51:10)

Offline

#9 2020-12-03 18:51:31

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 413
Website

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

What did you do to install it in the first place? It's your system this should be an easy answer. Irrespective of how it got there, Trilby's links will show you how to overwrite existing files that are unknown to pacman.


"the wind-blown way, wanna win? don't play"

Offline

#10 2020-12-03 19:01:33

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

Before this snowballs into more problems using forced overwrites, take a moment to remember how you installed powerline-shell.
If you installed it manually without pacman, then you should remove it manually and then re-install it with pacman, yay or whatever AUR helper you use.
If you installed it with pacman/yay/whatever, then you need to check your pacman database for corruption (e.g. does pacman -Qq list all of your packages),  and maybe even check your hard disk for errors with smart.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#11 2020-12-03 19:07:31

AirsoftHamster
Member
Registered: 2020-11-10
Posts: 74

Re: [SOLVED]Messed up something in my .bashrc, can't run commands anymore.

thanks Xyne! I was able to rename powerline-shell and then have yay reinstall it. I ran the two error checking commands and got no errors back! marking as solved.

Offline

Board footer

Powered by FluxBB