我创建了一个 Windows (10) Python 虚拟环境 (env3.7.3).当我打开一个在虚拟环境中激活的 cmd 窗口时,在虚拟环境中启动 Python 时收到以下警告消息:
I created a Windows (10) Python virtual environment (env3.7.3). When I open a cmd window activated in the virtual environment, I get the following warning message when starting Python in the virtual environment:
(env3.7.3) C:Users
edexOneDriveDocumentsEducationMachine Learning-Ng PythonExercise7>python
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
此警告之前已在不同的上下文中发布过,但它没有解决我的问题.此警告仅出现在 Python 虚拟环境中,而不是基本 Conda 环境中.这似乎是 Windows 或 Anaconda 环境变量问题,但我知之甚少!Anaconda 最近升级了,之前看起来还不错,所以可能存在错误或设置问题.
This warning has been posted before in a different context, but it did not address my question. This warning appears only in the Python virtual environment, not the base Conda environment. This seems like a Windows or Anaconda environment variable issue, but I don't know enough to know! Anaconda was recently upgraded and it seemed fine before, so there may be a bug or setting issue.
错误信息告诉你找到了来自Conda环境的Python解释器,但是conda activate 没有被调用.你把conda环境的bin/目录放到Windows搜索路径了吗?那是错误的.
The error message tells you that the Python interpreter from the Conda environment was found, but that conda activate <envname> has not been called. Did you put the bin/ directory of the Conda environment into the Windows search path? That would be wrong.
您说的是 virtualenvs.但是 Python 虚拟环境不同于 Conda 环境.也许你混淆了这两个概念?
You're talking about virtualenvs. But Python virtual environments are something else than Conda environments. Maybe you mixed up the two concepts?
来自 Conda 基础环境的 Python 解释器不会抱怨缺少激活,因为它由一些 conda 子命令调用,并且可以在没有激活环境的情况下工作.不过,在使用该 Conda 环境时,您也应该调用 conda activate base.
The Python interpreter from the Conda base environment does not complain about missing activation, because it's called by some of the conda subcommands and can work without an activated environment. Nevertheless, you should call conda activate base when working with that Conda environment, too.
这篇关于Python在Conda环境中,但在Windows虚拟环境中没有激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 python 解析非常大的 xml 文件时出现问题Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件时出现问题)
使用 Python 2 在 XML 中按属性查找所有节点Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按属性查找所有节点)
Python - 如何解析 xml 响应并将元素值存储在变量中Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 响应并将元素值存储在变量中?)
如何在 Python 中获取 XML 标记值How to get XML tag value in Python(如何在 Python 中获取 XML 标记值)
如何使用 ElementTree 正确解析 utf-8 xml?How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正确解析 utf-8 xml?)
将 XML 从 URL 解析为 python 对象Parse XML from URL into python object(将 XML 从 URL 解析为 python 对象)