PIP安装 - 覆盖路径,PIP寻找包装
我想更改PIP的默认安装路径。
ENV PIP_TARGET=/jup/site-packages\
PYTHONPATH="${PYTHONPATH}:/jup/site-packages"
当我运行PIP安装时,将所有内容安装在jup/site-packages
中。这很好。 PIP列表还返回正确的软件包。
但是,当我再次运行pip install
时,软件包再次安装,我会警告“目标目录”已经存在:
WARNING: Target directory /jup/site-packages/numpy already exists. Specify --upgrade to force replacement.
我希望我希望不再使用软件包已经安装了该软件包安装。 `
(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
我似乎Python仍然看错了包装的目录。我该如何解决?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论