'add Pyenv commands to bashrc or zshrc?

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dillon Davis