PIP安装 - 覆盖路径,PIP寻找包装

发布于 2025-02-01 00:08:29 字数 656 浏览 0 评论 0原文

我想更改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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文