conda build ignoring my activated environment?

2019-07-14 03:25发布

问题:

I've created a Python 3 Conda environment, expressly for the purpose of testing whether a particular package could be built, targeting Python 3, as opposed to 2. However, when I launch a conda build from this environment, it appears to want to target Python 2.7:

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

I can find nothing in the meta.yaml file, which is directing the build towards Python 2.7. Does anyone know what's going on, here, and how I direct this build at Python 3?

回答1:

Conda does not use your environment:

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

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

Therefore, you need to set the Python version explicitly:

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

Try:

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