# Conda env does not use proper python version

**URL:** <https://travis-ci.community/t/conda-env-does-not-use-proper-python-version/10786>\
**Category:** Linux\
**Tags:** python\
**Created:** [December 8, 2020, 12:11pm UTC](https://travis-ci.community/t/conda-env-does-not-use-proper-python-version/10786 "2020-12-08T12:11:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![j-bac](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/j-bac/32/5781_2.png) [@j-bac](https://travis-ci.community/u/j-bac)\
**Post date:** [December 8, 2020, 12:11pm UTC](https://travis-ci.community/t/conda-env-does-not-use-proper-python-version/10786/1 "2020-12-08T12:11:54Z")

</div>

With the latest miniconda, the python version specified for a new environment is not taken into account and python is set to version 3.9. However the exact same code works in linux environments and correctly uses lower python versions like 3.7 or 3.8.

Input code:

```auto
if [["$TRAVIS_OS_NAME" == 'linux']] && [["$TRAVIS_PYTHON_VERSION" == 2*]]; then
MINICONDA_PATH=$HOME/miniconda
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
export PATH=$MINICONDA_PATH/bin:$PATH
conda update -y conda
conda create -n testenv python=$TRAVIS_PYTHON_VERSION pip --yes
source activate testenv
conda install -y numpy scipy scikit-learn cython nose numba matplotlib pytest pytest-cov

```

Output error:

```auto
UnsatisfiableError: The following specifications were found

to be incompatible with the existing python installation in your environment:

Specifications:

  - matplotlib -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0']

  - numba -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.5,<3.6.0a0']

  - pytest-cov -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']

  - scikit-learn -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.5,<3.6.0a0']

  - scipy -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']

Your python: python=3.9

```

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 8, 2020, 7:47pm UTC](https://travis-ci.community/t/conda-env-does-not-use-proper-python-version/10786/2 "2020-12-08T19:47:35Z")

</div>

I see a few issues:

- You are installing Miniconda yourself, with `miniconda.sh` that you provide. So you don’t need Travis’ Python, it only wastes time and makes things more confusing. Use `language: generic`.
- `source activate testenv` likely has no effect. You should rather use `conda activate`.
  - This means that you are still using Travis’ Python after than line, producing the effect that you are seeing
