I'm trying to install any packages to venv, but the pip install command's target directory is always /opt/homebrew/lib/python3.12/site-packages/, but I'd expect it to be something under venv.
Here is how to replicate in my local machine:
python3.12 -m venv venvto create venvsource venv/bin/activateto load the environment- My
which python3.12andwhich pip3.12all points to the correct path, i.e.,<repo_directory>/venv/bin/python3.12
Then, when I try pip3.12 install hello-world, it shows:
Collecting hello-world
Using cached hello_world-0.2-py3-none-any.whl
Installing collected packages: hello-world
Successfully installed hello-world-0.2
WARNING: Target directory /opt/homebrew/lib/python3.12/site-packages/hello.py already exists. Specify --upgrade to force replacement.
WARNING: Target directory /opt/homebrew/lib/python3.12/site-packages/hello_world-0.2.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /opt/homebrew/lib/python3.12/site-packages/bin already exists. Specify --upgrade to force replacement.
What can I try next?
pythonandpipshould be sufficient.python -m pip install <package name>. In fact, I only ever use pip this way.env | grep PYTHON?