Skip to main content
 首页 » 编程设计

python之conda build 忽略了我激活的环境

2024年10月01日37sharpest

我创建了一个 Python 3 Conda 环境,明确用于测试是否可以构建特定包,目标是 Python 3,而不是 2。但是,当我启动 conda build 从这个环境来看,它似乎想要以 Python 2.7 为目标:

(pybert_py3) Davids-MacBook-Air-2:PyBERT dbanas$ conda build conda.recipe/chaco/ 
BUILD START: chaco-4.6.1-py27_0 

我在 meta.yaml 文件中找不到任何内容,该文件将构建指向 Python 2.7。有谁知道这里发生了什么,以及我如何在 Python 3 上指导这个构建?

请您参考如下方法:

Conda 不使用您的环境:

https://docs.conda.io/projects/conda-build/en/latest/concepts/recipe.html

  1. Creates a build environment and installs the build dependencies there.

因此,需要明确设置Python版本:

--python PYTHON_VER Set the Python version used by conda build.

尝试:

conda build --python=3.6 conda.recipe/chaco/