2016-08-25 2 views
-1

ich diese Richtungen gefolgt: https://askubuntu.com/questions/320996/make-default-python-symbolic-link-to-link-to-python3Alias ​​funktioniert nicht auf Ubuntu 16.04 für Python3

Die Website gab Anweisungen, wie 3. einen Alias ​​für Python machen Es ist ziemlich einfach, aber ich kann nicht sehen, wie es isn‘ t arbeitet für mich. Diese

ist das, was ich getan habe:

[email protected]:~$ cat ~/.bash_aliases 
alias py=python3 
[email protected]:~$ source ~/.bash_aliases 
[email protected]:~$ py 
py: command not found 

[email protected]:~$ alias 
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' 
alias egrep='egrep --color=auto' 
alias fgrep='fgrep --color=auto' 
alias grep='grep --color=auto' 
alias l='ls -CF' 
alias la='ls -A' 
alias ll='ls -alF' 
alias ls='ls --color=auto' 
alias py='python3' 
alias python='python3' 
alias python3='py' 

[email protected]:~$ which python3 
/usr/bin/python3 

Ich bin sicher, dass es etwas einfacher ist, dass ich fehle.

EDIT 1: 'alias' und 'die python3' Befehl hinzugefügt wird

+1

Was die Ausgabe der folgenden Befehle ist: 'alias' und' die python3'? –

+0

@ChristianTernus Code wird hinzugefügt. Ich sehe, dass ich einen Alias ​​für python = 'python3' habe. Macht das irgendwas? Ich habe es vorher hinzugefügt, aber es gelöscht und die Datei ersetzt. –

Antwort

1

Sie haben zirkular die py='python3' alias definiert. Um dies zu beheben, ungesetzt die python3='py' Alias, indem Sie:

unalias python3

+0

Danke! Haben die Unalias und es funktioniert jetzt. –