1

I've installed pyenv to activate Python 3.9, and that appears to have worked:

maxghenis@MacBook-Air-3 policyengine-canada % pyenv versions       
  system
* 3.9.16 (set by /Users/maxghenis/.pyenv/version)
maxghenis@MacBook-Air-3 policyengine-canada % python -V
Python 3.9.6

But when I run pip3 install -e . in this project, it fails with an error message that suggests it's using Python 3.10:

× Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Error in sitecustomize; set PYTHONVERBOSE for traceback:
      AssertionError:
      Traceback (most recent call last):
        File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>

How can I ensure that pip3 uses 3.9?

Max Ghenis
  • 14,783
  • 16
  • 84
  • 132
  • 2
    Try ```python -m pip3 install -e .``` Alternatively u can try pip instead of pip3 – Gunesh Shanbhag Dec 25 '22 at 19:02
  • you can alternatively use ```pyenv pip install -e .``` – Gunesh Shanbhag Dec 25 '22 at 19:13
  • `pythom -m pip` is the best way to make sure you are running the correct pip for the current `python` – zvone Dec 25 '22 at 19:16
  • 1
    It sounds like your `PATH` is set up in a way that your homebrew python is getting used instead of pyenv's, possibly due to it getting set differently in non-login/non-interactive shells. Check your `.*rc` and `.*profile` files (are you using bash or zsh?). The pyenv shims should come before homebrew in `PATH`. – booshong Dec 26 '22 at 06:50

0 Answers0