This tutorial to create virtual environments suggests, that I should add these commands to my .bashrc file:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
On the home directory of my macOS, when I check for ls -a, I do not see a .bashrc file. I do see however a .zshrc file. Is this an alternative? Can I put the commands here or should I create a new .bashrcfile in my home directory using nano or similar?
CodePudding user response:
You should run echo $0 to check which shell you're using, but I would be fairly certain no .bashrc means no bash shell in use. If you're using a later version of macOS then zsh will be in use already as the default shell (but bash is in use on older versions pre-Catalina by default).
If echo $0 does output bash or /bin/bash rather than zsh or /bin/zsh then you should create a .bashrc file and put the commands in it - but if your output contains zsh, then you should put the commands in the .zshrc file already in existence.
CodePudding user response:
Yes, this is the file you want to edit if you're on a mac. .bashrc is a configuration file for the bash shell (an extremely common shell, often assumed to be the ubiquitous shell). This file is sourced every time you start a new shell (running all the commands within). On mac however, the default is zsh, which uses .zshrc as its configuration file.
