Reputation: 7048
Can anyone shed any light on how to have pythonbrew / pythonz install when my shell is ZSH. I am on ubuntu 12.04.
I have followed the standard install of curl and then adding the line to ~/.bashrc but it will return an unknown command in a new zsh terminal.
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
Upvotes: 1
Views: 882
Reputation: 2618
In case anyone stumbles across this old question:
As I write this (late 2017), pythonbrew
is unmaintained and pythonz
appears to be in maintenance-only mode.
At this time I would strongly suggest users switch to the actively maintained pyenv
instead.
And just for the record, pyenv
fully supports bash, zsh and fish.
Upvotes: 0
Reputation: 10970
You can try the emulate command in your zshrc.
emulate sh -c '[[ -s $HOME/.pythonbrew/etc/bashrc ]] && . $HOME/.pythonbrew/etc/bashrc'
I have a different setup (my emulate calls a functionrc that has functions available to bash and zsh), but I think this is going to work.
Upvotes: 0
Reputation: 5629
The bashrc file does not work with zsh unfortunately.
Take python2.5 as an example, this seems to work:
sudo ~/.pythonbrew/bin/pythonbrew install 2.5
Then to invoke python2.5:
~/.pythonbrew/pythons/Python-2.5/bin/python
For convenience set:
$PATH=$HOME/.pythonbrew/pythons/Python-2.5/bin:$PATH
Upvotes: 2
Reputation: 4768
zsh does not read ~/.bashrc - try putting the same code in ~/.zshrc
Upvotes: 0