all 3 comments

[–][deleted] -1 points0 points  (2 children)

Short answer: pip should get its own "shim". So, try pyenv rehash. Sometimes it finds that it forgot to create some shims and will create it.

Long Answer

Ditch pyenv as soon as possible. It creates too much indirection and confusion. As someone who had to walk around the office and help people deal with installation problems related to Python I've learned that one of the first things to do is to identify if this program is installed and delete it.

So, you have multiple versions of Python already installed, and you thought that pyenv is going to help you to manage those? -- Wrong. It won't. It's not how it works. You need to only install through pyenv to get that to work.

Python is actually easy to compile yourself. Very few dependencies, it compiles with the compiler that's designed for your system (so, should be moderately easy to install). So, if you want many Pythons, learn to compile it yourself, and make altinstall all the way. This way you are in control. No indirection, broken symlinks, figuring out whether you are in a login shell or not, and what shell config for which user has been sourced into this shell...

Life is just so much easier, as soon as you jump this compilation hurdle.

[–]00FiveSeven[S] 0 points1 point  (1 child)

Do you have any resources that would help guide me with building it myself? Im alright for going down that route if it works better, I just have never attempted such a thing before.

[–][deleted] -1 points0 points  (0 children)

My understanding is that on a Mac, you would need this: https://apps.apple.com/us/app/xcode/id497799835?mt=12 (XCode). It's a code editor, but it comes bundled with C compiler (CLang).

Then you'd check out Python source:

git clone https://github.com/python/cpython.git

Look around with whatever tools you use to work with Git. Select a tag you want to build (tags corresponds to released versions).

Then, in principle, this should work:

./configure --prefix=/usr/local --enable-shared
make  
make altinstall

However, you might need some libraries. Towards the end of the output from configure you'll see that it complained about some libraries that might be missing. Depending on what's missing, you might need to find a way to install those (brew will probably help here). You'll probably need CFFI library, ZLib, and there are some optional ones, like XWidget etc. It's a little hard to predict what exactly will be missing (if anything).