0

I've tried several ways to downgrade the python3, including using pyenv, but it has the build failed error. I think it's probably because my python3 is in my usr/bin folder and I can not delete it. For the course requirement, I really need to downgrade python to 3.5. Is there any way to do so?

2 Answers2

1

I recommend using Anaconda to install the specific python version. like it:

conda create -n py35 python=3.5
Verizz
  • 108
  • 1
  • 7
0

First of all, install brew if is not already installed. Then add it to user path by:

export PATH=/opt/homebrew/bin:$PATH

Once done Restart your shell:

exec zsh -l

Now Check Python is located where:

which python

Next, Go through following steps:

  1. Check if you have pyenv already installed on mac OS.

    pyenv --version -- Optional since you already stated that pyenv is present at your machine.

  2. List all available version for python:

    pyenv install --list

  3. Install desired python version:

    pyenv install 3.5

  4. Set python 3.5 version globally:

    pyenv global 3.5

  5. Check again if python is located whether in user's directory:

    which python

it should be pointing to your /Users/usrone/.pyenv/shims/python if not then set it again : pyenv global 3.5

  1. Update your .zshrc

    if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi PATH=$(pyenv root)/shims:$PATH

  2. Restart zsh terminal:

    exec zsh -l

You can also read excerpts from Downgrade Python version SO answer

Chandan
  • 217
  • 1
  • 3
  • 17