Anaconda works like a containerized environment (virtual environment) which maintains it's own version of libraries and python version installed.
If you installed a python library on the Mac/Linux terminal (without running 'conda activate base'), it then installs it to the native version of python installed on Mac, not on Anaconda.
If you wish to run the code on your local/Mac version of Python go to the terminal and type:
pip install oauthlib
And then run the python code on the terminal itself without switching to Anaconda(since Anaconda seems to be giving an error)
In-case the command 'conda' doesn't work, running conda init
and closing and opening the terminal again should do the trick.
In-case it doesn't work you need to figure out the SHELL the terminal is running on using:
echo $(which SHELL)
Output should be something like this
/usr/bin/zsh
If it's zsh then place this into your following zshrc and if it's bash then it's bashrc present in the home directory.
nano ~/.zshrc
or
nano ~/.bashrc
And paste this to the end of the file
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/bitsage/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/bitsage/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/bitsage/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/bitsage/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<