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
David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article