VENV激活后,Python PIP引用了全局路径

发布于 2025-01-29 04:40:35 字数 410 浏览 3 评论 0原文

我已经安装了新的MX-Linux。我的PC包含1个SSD,其中安装了OS和1个HDD,我一直将项目以及其他一般性物品(照片等)进行。现在,我遇到的问题是,当我在硬盘驱动器中的任何项目中创建一个新的虚拟环境时,它都已经安装了所有的全球依赖关系,无论它是否具有我所需的项目所需的依赖项,它都会' LL无法运行。在此

我跑了Windows,Fedora,Mint和现在的MX。以前从未有这个问题,我在网上找不到任何相关的问题,谢谢。

(venv) mx-linux@mx:/media/seconddrive/python-project/typer

$ which python
/media/seconddrive/python-projects/typer/venv/bin/python

$ which pip
/usr/bin/pip

I've a fresh installed MX-Linux. My PC contains 1 SSD with the OS installed and 1 HDD where I've always had my projects along with other general stuff (Photos etc..). Now the issue I'm having is that when I create a new virtual environment in any project inside my hard drive, it comes with all the global dependencies installed already and no matter if it has the dependencies a said project of mine requires, it'll fail to run. In this screenshot at the top you will find how my venv looks like when I create it in my SSD (Which is how it is expected and works properly) and at the bottom how it looks when I create in inside my HHD. You see, the problem is that even after venv is activated, the pip path points to the global instead of the venv's

I've ran windows, fedora, mint and now MX. Never had this issue before and I can't find anything related online, thanks..

(venv) mx-linux@mx:/media/seconddrive/python-project/typer

$ which python
/media/seconddrive/python-projects/typer/venv/bin/python

$ which pip
/usr/bin/pip

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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