可以激活虚拟环境 - 在我的计算机上安装conda时,用内置的Python模块VENV创建

发布于 2025-01-29 19:13:32 字数 375 浏览 5 评论 0原文

我使用此命令创建了一个python虚拟环境:

$ python -m venv panda

它已成功创建,但是当我尝试使用以下错误激活环境时:

$ activate panda/Scripts/activate.bat

它给我以下错误:

Not a conda environment: F:\panda\Scripts\activate.bat

我使用:

  • conda 4.10.3
  • python 3.9.7
  • git bash 2.35.1 .Windows.2

I created a python virtual environment using this command:

$ python -m venv panda

It has been created successfully but when I try to activate the environment using:

$ activate panda/Scripts/activate.bat

It gives me the following error:

Not a conda environment: F:\panda\Scripts\activate.bat

I'm using:

  • conda 4.10.3
  • Python 3.9.7
  • Git Bash 2.35.1.windows.2

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘然心甜 2025-02-05 19:13:32

您可能想查看这个问题:如何来源Virtualenv在bash脚本中激活。它可能有助于激活bash中的环境。

。 ./panda/scripts/activate应激活您的环境;但是,它是一个虚拟环境,而不是conda环境。

如果您想使用Conda虚拟环境,则此页面可能会有所帮助: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

You may want to take a look at this question: How to source virtualenv activate in a Bash script. It may help with activating environments in bash.

. ./panda/scripts/activate should activate your environment; however, it with be a Python virtual environment and not a Conda environment.

If you are trying to use a Conda virtual environment, this page may help: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文