tox-dev / tox-conda

Make tox cooperate with conda envs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 0.8 breaks conda invocation on Linux

brandon-leapyear opened this issue · comments

Running tox in CI shows an error:

conda: error: argument command: invalid choice: '/home/circleci/miniconda/bin/conda'
(choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade',
'remove', 'uninstall', 'config', 'clean', 'package')

This only happens in CI; locally on Mac with 0.8 works fine.

OS: Debian 8 (Docker image: circleci/python:3.6.3)
miniconda version: 4.3.31

Full output log
$ PATH=/home/circleci/miniconda/bin:$PATH python/tox.sh -edocs -vvvvvv

using tox.ini: /home/circleci/project/python/tox.ini (pid 1517)
removing /home/circleci/project/python/.tox/log
could not satisfy requires PackageNotFoundError('tox-conda',)
could not satisfy requires PackageNotFoundError('tox-wheel',)
using tox-3.23.0 from /usr/local/lib/python3.6/site-packages/tox/init.py (pid 1517)
/usr/local/bin/python (/usr/local/bin/python) is {'executable': '/usr/local/bin/python', 'implementation': 'CPython', 'version_info': [3, 6, 3, 'final', 0], 'version': '3.6.3 (default, Dec 12 2017, 16:40:53) \n[GCC 4.9.2]', 'is_64': True, 'sysplatform': 'linux', 'extra_version_info': None}
.tox uses /usr/local/bin/python
.tox start: getenv /home/circleci/project/python/.tox/.tox
.tox reusing: /home/circleci/project/python/.tox/.tox
.tox finish: getenv /home/circleci/project/python/.tox/.tox after 0.04 seconds
.tox start: finishvenv
.tox finish: finishvenv after 0.00 seconds
.tox start: provision
[1603] /home/circleci/project$ /home/circleci/project/python/.tox/.tox/bin/python -m tox -c python/tox.ini -edocs -vvvvvv
using tox.ini: /home/circleci/project/python/tox.ini (pid 1603)
using tox-3.23.0 from /home/circleci/project/python/.tox/.tox/lib/python3.6/site-packages/tox/init.py (pid 1603)
docs start: packaging
docs cannot reuse: no previous config /home/circleci/project/python/.tox/docs/.tox-config1
docs create: /home/circleci/project/python/.tox/docs
removing /home/circleci/project/python/.tox/docs
[1985] /home/circleci/project$ /home/circleci/miniconda/bin/conda -h >python/.tox/log/docs-0.log
python (/home/circleci/miniconda/bin/python) is {'executable': '/home/circleci/miniconda/bin/python', 'implementation': 'CPython', 'version_info': [3, 6, 3, 'final', 0], 'version': '3.6.3 |Anaconda, Inc.| (default, Nov 20 2017, 20:41:42) \n[GCC 7.2.0]', 'is_64': True, 'sysplatform': 'linux', 'extra_version_info': None}
docs uses None
setting PATH=/home/circleci/project/python/.tox/docs/bin:/home/circleci/miniconda/bin:/home/circleci/miniconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
[1991] /home/circleci/project/python/.tox$ /home/circleci/miniconda/bin/conda create --yes -p docs python=3.9 >log/docs-1.log
docs uses /home/circleci/project/python/.tox/docs/bin/python
docs installdeps: -rrequirements/docs-requirements.txt, -crequirements/docs-constraints.txt
setting PATH=/home/circleci/project/python/.tox/docs/bin:/home/circleci/miniconda/bin:/home/circleci/miniconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
[2013] /home/circleci/project/python$ /home/circleci/project/python/.tox/docs/bin/python -m pip install -rrequirements/docs-requirements.txt -crequirements/docs-constraints.txt
usage: conda [-h] [-V] command ...
conda: error: argument command: invalid choice: '/home/circleci/miniconda/bin/conda' (choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade', 'remove', 'uninstall', 'config', 'clean', 'package')
ERROR: invocation failed (exit code 2)
docs wheel-make: cleaning up build directory ...
docs start: wheel-make
docs wheel-make: commands[0] | python /home/circleci/project/python/setup.py bdist_wheel --dist-dir /home/circleci/project/python/.tox/dist
setting PATH=/home/circleci/project/python/.tox/docs/bin:/home/circleci/miniconda/bin:/home/circleci/miniconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
[2018] /home/circleci/project/python$ /home/circleci/project/python/.tox/docs/bin/python setup.py bdist_wheel --dist-dir /home/circleci/project/python/.tox/dist
usage: conda [-h] [-V] command ...
conda: error: argument command: invalid choice: '/home/circleci/miniconda/bin/conda' (choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade', 'remove', 'uninstall', 'config', 'clean', 'package')
ERROR: InvocationError for command /home/circleci/project/python/.tox/docs/bin/python setup.py bdist_wheel --dist-dir /home/circleci/project/python/.tox/dist (exited with code 2)
docs finish: wheel-make after 0.28 seconds
ERROR: No dist directory found. Please check setup.py, e.g with:
python setup.py bdist_wheel
.tox finish: provision after 6.17 seconds

The conda run command seems available since conda version 3.6.0 in 2014.
What is you version of conda?

I put it in the description. 4.3.31

This is probably the version of miniconda, not of the conda command line tool.
What gives conda --version?

$ /home/circleci/miniconda/bin/conda --version
conda 4.3.31

What gives conda --help?

I don't have the CI environment anymore, but on Mac, I get

usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    info         Display information about current conda install.
    help         Displays a list of available conda commands and their help
                 strings.
    list         List linked packages in a conda environment.
    search       Search for packages and display their information. The input
                 is a Python regular expression. To perform a search with a
                 search string that starts with a -, separate the search from
                 the options with --, like 'conda search -- -h'. A * in the
                 results means that package is installed in the current
                 environment. A . means that package is not installed but is
                 cached in the pkgs directory.
    create       Create a new conda environment from a list of specified
                 packages.
    install      Installs a list of packages into a specified conda
                 environment.
    update       Updates conda packages to the latest compatible version. This
                 command accepts a list of package names and updates them to
                 the latest versions that are compatible with all other
                 packages in the environment. Conda attempts to install the
                 newest versions of the requested packages. To accomplish
                 this, it may update some packages that are already installed,
                 or install additional packages. To prevent existing packages
                 from updating, use the --no-update-deps option. This may
                 force conda to install older versions of the requested
                 packages, and it does not prevent additional dependency
                 packages from being installed. If you wish to skip dependency
                 checking altogether, use the '--force' option. This may
                 result in an environment with incompatible packages, so this
                 option must be used with great caution.
    upgrade      Alias for conda update. See conda update --help.
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove. See conda remove --help.
    config       Modify configuration values in .condarc. This is modeled
                 after the git config command. Writes to the user .condarc
                 file (/Users/bchinn/.condarc) by default.
    clean        Remove unused packages and caches.
    package      Low-level conda package utility. (EXPERIMENTAL)

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

other commands, such as "conda build", are available when additional conda
packages (e.g. conda-build) are installed

I doubt it's the conda CLI interface, since 0.8 works on Mac

It looks like the conda run command had been removed around conda 4.0.9 (issue, issue) and put back somewhere between conda versions 4.6 and 4.7.
It is not clear to me when that happened exactly though ...

Why does it work on Mac then? conda run shouldn't exist on Mac either

What is your version of conda on Mac?

The same

moved to #75

@ailin-nemui
This looks like to be a different problem, would you mind to create a separate issue please?

@brandon-leapyear
I guess you may have to update your conda.

What does it work on Mac but not Linux?

I'm sorry but I have no idea and I cannot test on a Mac.

well we solved it by pinning tox-conda to < 0.8. It would be nice if tox-conda could specify (at least in README and/or CHANGELOG) what version of miniconda it requires

Will do once I've figured out which versions of conda provide it!

Closing now the docs has been updated.