Celeb Glow
updates | March 30, 2026

How can I solve the problem “Ubuntu 20.04 pyenv command not found”?

I am installing pyenv using this command:

git clone pyenv/pyenv-virtualenv ~/.pyenv/plugins/pyenv-virtualenv

Then

echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc

When I give this command, an error appears

$ source ~/.bashrc
Command 'pyenv' not found, did you mean: command 'p7env' from deb libnss3-tools (2:3.49.1-1ubuntu1.5) command 'pyvenv' from deb python3-venv (3.8.2-0ubuntu2)

My commands are as follow:

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo −e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
sudo apt-get install libc6-dev gcc
sudo apt-get install -y make build-essential zlib1g-dev libssl-dev libsqlite3-dev libbz2-dev libreadline-dev wget curl llvm
git clone ~/.pyenv/plugins/pyenv-virtualenv
2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy