I want to change the default installation path of pip.
ENV PIP_TARGET=/jup/site-packages\
PYTHONPATH="${PYTHONPATH}:/jup/site-packages"
When I run pip install everything is installed in jup/site-packages
. This works fine. pip list also returns the correct packages.
However, when I run pip install
again, the packages get installed again and I get a warning that the target directory already exists:
WARNING: Target directory /jup/site-packages/numpy already exists. Specify --upgrade to force replacement.
I would expect to not do the installation again with the message that the package is already installed. `
(app-root) bash-4.4# python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
/opt/app-root/lib/python3.9/site-packages
I seems that Python still looks in the wrong directory for packages. How can I fix this?