eval "$(pyenv init --path)"
eval "$(pyenv init --path)"does.
OK so far no go, the instructions state: MacOS note: If you installed Pyenv with Homebrew, you don't need to add the PYENV_ROOT= and PATH= lines. You also don't need to add commands into ~/.profile if your shell doesn't use it.
so I created ~/.zprofile and simply put eval "$(pyenv init --path)" inside of it.
I left the following in .zshrc per the instructions:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
restart the terminal, message is still there.
I'm confused about how modules are being located. I've installed pyenv as a git clone and am able to install python versions, but they seem there seems to be a discrepancy regarding
I've installed a version and selected it:
pyenv global 3.9.5
When installing a package with:
pip install msgpack
I get the output:
Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: msgpack in /usr/lib/python3.9/site-packages (1.0.2)
But when I try to use that package at a python repl:
Python 3.9.5 (default, May 8 2021, 22:00:35) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import msgpack Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'msgpack'
sys.path does not show /usr/lib/python3.9/site-packages:
>>> import sys; print(sys.path) ['', '/home/jeremy/.pyenv/versions/3.9.5/lib/python39.zip', '/home/jeremy/.p5/lib/python3.9', '/home/jeremy/.pyenv/versions/3.9.5/lib/python3.9/lib-dynly/.local/lib/python3.9/site-packages', '/home/jeremy/.pyenv/versions/3.9.5/lpackages']
pip install --force-reinstallas a workaround, but why does the install command above see /usr/lib but not python?
pyenv which pip?
python -m pip install msgpackgive the same results? It looks like
pipis finding the system installed packge, which it shouldn't when inside a venv.
--userinstalls with pyenv's pip?
--userwith the pip from pyenv.