my OS: macOS Big Sur 11.5.1 (20G80)
cpu Arch: Intel cpu, amd64
pyenv: 2.3.20
Python version: 3.11.4
c compiler info:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I install pyenv
and pyenv-virtualenv
using brew
brew install pyenv
brew install pyenv-virtualenv
I'm using fish-shell, so after installing, I put pyenv init - | source
in to ~/.config/fish/config.fish
and source it, I didn't change PYENV_ROOT
, so PYENV_ROOT
defaults to $HOME/.pyenv
.
Then I try the following operations
# create virtual environment
pyenv virtualenv 3.8 jarvis
# enter virtual environment
pyenv activate jarvis
# deactivate virtual environment
pyenv deactivate
for now, everything seems works fine
But there is a problem: if I check the python3
/pip3
's location, they are all under /Users/bruce/.pyenv/shims/
even if I didn't activate the virtual environment, which is not right.
Even more wierder is: the pip3
itself was installed at /usr/local/lib/python3.11/site-packages/
(screenshot above), but isn't it should be in ~/.pyenv/versions/3.8.16/envs/jarvis/lib/python3.8/site-packages
?(screenshot below)
In fact I can accept using the python3
and pip3
in pyenv location even I didn't enter(activate) the virtual environment, but the point is: it separates the pip3
and pip package installation location, on one hand, which pip3
says the pip3
is located at /Users/bruce/.pyenv/shims/pip3
, on the other hand, pip3 --version
says pip3
is at /usr/local/lib/python3.11/site-packages/pip
, so where on earth does the pip located at?