重装后重新激活pycharm虚拟环境
不久前我为我的一个 PyCharm 项目设置了一个虚拟环境。在某个时候,我卸载了 Anaconda,然后重新安装了它。现在,我在尝试编译项目时遇到模块导入错误,并且我相信我需要重新激活环境,因为当我在 venv 文件夹中加载 python.exe
文件时收到此错误:
“这个Python解释器处于conda环境中,但是 环境尚未激活。库可能无法加载。”
如何重新激活环境? 我的项目目录中有一个文件夹,其中有一个 activate.bat 文件,但运行该文件似乎没有执行任何操作。
如何(重新)激活我知道 conda activate 命令,但我仍然不确定如何在项目目录中添加现有虚拟环境。
I set a virtual environment for one of my PyCharm projects a while ago. At some point, I uninstalled Anaconda and then reinstalled it. I now get module import errors when trying to compile my project, and I believe I need to reactivate the environment, since I get this error when I load the python.exe
file in the venv folder:
"This Python interpreter is in a conda environment, but the
environment has not been activated. Libraries may fail to load."
How do I reactivate the environment? There is a folder in the directory of my project, with an activate.bat file, but running this does not appear to do anything.
How do I (re)activate an existing virtual environment in a specific directory for my project? I'm aware of the conda activate
command, but I am still unsure how to add an existing one in my project directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法弄清楚如何做到这一点,所以我重新安装了我在新的 Anaconda 构建中使用的所有(特定版本)软件包。
I was unable to figure out how to do this, so I reinstalled all (specific versions of) packages I was using on my fresh Anaconda build.