Question: I use `pyenv` to manage my Python environments and I get the following when simply running `bash`.

```
$ bash
pyenv: bash: command not found

```

I was trying to troubleshoot why `pipenv shell` failed with the above error, which is how I found out even `bash` wasn't working. I tried updating `pipenv` via `brew` and ran `pyenv rehash` to regenerate the shims. And `bash` is definitely present.

```
$ which bash
/bin/bash

```

I expected that if `pyenv` doesn't find a command, the subsequent paths specified by the `PATH` environment variable will be searched. Interestingly if I execute some non-existant command I don't get a `pyenv` error.

```
$ someboguscommand
-bash: someboguscommand: command not found

```

This suggests to me that `pyenv` doesn't even search for a matching command in this case and the subsequent paths in `PATH` are searched, so there must be some special handling with `bash`.

Answer: 
I had this issue when setting up **Python 3.8** on **CentOS** using **Pyenv**.

I was running into the error below when I run `pyenv install 3.8.2`:

```
pyenv: bash: command not found

```

**Here's how I solved it**:

The issue was pyenv was not added to the load path for my profile.

All I had to do was to do the following:

Open the `.bashrc` file in the home directory of my user:

```
sudo nano ~/.bashrc

```

Next, add the following add the bottom of the file and save:

```
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

```

Finally, restart your terminal or run the command below to load the newly added paths into your current shell/terminal session:

```
exec "$SHELL"

```

Now when you run the command `pyenv install 3.8.2` it should work fine.

**Resources**: [Managing Multiple Python Versions With pyenv](https://realpython.com/intro-to-pyenv/)

That's all.

**I hope this helps**
The issue was that I had the following line in my `.bashrc`, which was being invoked when running `bash`. It's a line that I no longer need:

```
. virtualenvwrapper.sh

```

This was in turn invoking pyenv's virtualwrapper shim:

```
$ which virtualenvwrapper.sh
/Users/greg/.pyenv/shims/virtualenvwrapper.sh

```

That's what caused the failure. I was able to identify this by running a debug trace with `bash`:

```
$ bash -x
+ . virtualenvwrapper.sh
++ set -e
++ '[' -n '' ']'
++ program=bash
++ [[ bash = \p\y\t\h\o\n* ]]
++ export PYENV_ROOT=/Users/greg/.pyenv
++ PYENV_ROOT=/Users/greg/.pyenv
++ exec /usr/local/Cellar/pyenv/1.2.13_1/libexec/pyenv exec bash
pyenv: bash: command not found

```

Thank you for the useful comments "that other guy", Charles Duffy, and rje!