When create an conda environment pip location is wrong

I create a conda environment when I do

which python 
/opt/miniconda3/envs/my-code/bin/python
 which pip
/Library/Frameworks/Python.framework/Versions/3.13/bin/pip

pip location should be pointing to

/opt/miniconda3/envs/my-code/bin/pip

how to fix this
due to this pip install is going to wrong location
I am using macos

What’s the output of conda list -n my-code pip? Make sure that environment contains pip: conda install -n my-code pip.

As a workaround, you can also invoke the env’s pip via python -m pip install ....

conda (no longer) automaticaly installs pip.

conda list to be sure, but I’m guessing there is no pip in your environment, so it picks up the global one.

conda install pip should take care of it.

Actually, that probably will fail, if pip is not installed – but that’s good advice in general, in this case, you want the failure, rather than the wrong pip.

Note that invoking pip via python -m has been the recommended way to do it for years – even without conda there are many ways to get out of sync!