mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.87k stars 353 forks source link

No module named 'conda._vendor.auxlib' #1583

Closed skapin closed 2 years ago

skapin commented 2 years ago

This is weird, I can't use mamba with my new python3.8 (on conda activate env.)

(base) root@c212c1a0a85b:/# mamba
Traceback (most recent call last):
  File "/opt/conda/bin/mamba", line 7, in <module>
    from mamba.mamba import main
  File "/opt/conda/lib/python3.8/site-packages/mamba/mamba.py", line 53, in <module>
    from mamba.utils import get_index, to_package_record_from_subjson, _supplement_index_with_system
  File "/opt/conda/lib/python3.8/site-packages/mamba/utils.py", line 7, in <module>
    from .FastSubdirData import FastSubdirData
  File "/opt/conda/lib/python3.8/site-packages/mamba/FastSubdirData.py", line 23, in <module>
    from conda._vendor.auxlib.ish import dals
ModuleNotFoundError: No module named 'conda._vendor.auxlib'

Conda version =>

(base) root@c212c1a0a85b:/# conda --version conda 4.12.0

Mamba version

(base) root@c212c1a0a85b:/# conda list | grep mamba mamba 0.1.2 py38hbf85e49_0 conda-forge

What I have done ?

pip install auxlib (base) root@c212c1a0a85b:/# pip install auxlib Requirement already satisfied: auxlib in /opt/conda/lib/python3.8/site-packages (0.0.43)

wolfv commented 2 years ago

@skapin I just checked and -- this is a really really old mamba version that you have installed.

We don't use this code anymore, and it appears that conda has removed this particular module.

skapin commented 2 years ago

Yes thank you, somes package downgrade mamba for no apparente reason .......... sorry

ndevenish commented 2 years ago

I've also just had a fresh environment spontaneously install this version of mamba....

99snowleopards commented 2 years ago

doing conda install mamba -c conda-forge in a new Python 3.8 env installs this version of mamba by default:

mamba conda-forge/linux-64::mamba-0.1.2-py38hbf85e49_0

It takes a very long time to solve the env when specifying a more recent version of Mamba during install

JZL commented 2 years ago

This might be unique to me but after a lot of debugging, I got this error because I had messed with my PATH priority and it was overriding the anaconda paths. As a quick check, maybe make sure which conda/which mamba/which python3/... all point to anaconda not somewhere else (Mine was point to ~/.local/bin)

99snowleopards commented 2 years ago

thanks for replying @JZL - I confirmed that which conda/which mamba/which python3/... all point to anaconda not somewhere else, this issue also happens in a new Python 3.6 environment

ctb commented 2 years ago

doing conda install mamba -c conda-forge in a new Python 3.8 env installs this version of mamba by default:

mamba conda-forge/linux-64::mamba-0.1.2-py38hbf85e49_0

It takes a very long time to solve the env when specifying a more recent version of Mamba during install

I see the same thing - that I get 0.1.2 in a new Python 3.8 env.

I'm currently trying:

conda create -y -n newenv "python=3.8" "mamba>=0.22.1"

which seems to work.

ReimarBauer commented 2 years ago

Solution for the following description was to update conda-build in the base environment

Hi, I just ran in this too by conda build .

updating to conda 4.12.0 doesn't fixed it, my setup was:

mamba version

 mamba list mamba
# packages in environment at /home/reimar/miniconda3/envs/mssdev:
#
# Name                    Version                   Build  Channel
libmamba                  0.22.1               hd8a31e3_1    conda-forge
libmambapy                0.22.1           py39hd55135b_1    conda-forge
mamba                     0.22.1           py39hfa8f2c8_1    conda-forge

conda version

mamba list conda
# packages in environment at /home/reimar/miniconda3/envs/mssdev:
#
# Name                    Version                   Build  Channel
conda                     4.12.0           py39hf3d152e_0    conda-forge
conda-package-handling    1.7.3            py39h3811e60_1    conda-forge
conda-souschef            2.1.1              pyhd8ed1ab_0    conda-forge
conda-verify              3.1.1           py39hf3d152e_1004    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge

traceback

Copying /home/reimar/PycharmProjects/MSS to /home/reimar/miniconda3/conda-bld/msstmp_1650974722179/work/
Traceback (most recent call last):
  File "/home/reimar/miniconda3/bin/conda-build", line 11, in <module>
    sys.exit(main())
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/cli/main_build.py", line 481, in main
    execute(sys.argv[1:])
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/cli/main_build.py", line 470, in execute
    outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post,
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/api.py", line 186, in build
    return build_tree(
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/build.py", line 3068, in build_tree
    packages_from_this = build(metadata, stats,
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/build.py", line 2120, in build
    m.parse_until_resolved(allow_no_other_outputs=True)
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/metadata.py", line 1061, in parse_until_resolved
    self.parse_again(permit_undefined_jinja=True, allow_no_other_outputs=allow_no_other_outputs,
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/metadata.py", line 1001, in parse_again
    self.meta = parse(self._get_contents(permit_undefined_jinja,
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/metadata.py", line 1568, in _get_contents
    env.globals.update(environ.get_dict(m=self, skip_build_id=skip_build_id))
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/environ.py", line 282, in get_dict
    d.update(meta_vars(m, skip_build_id=skip_build_id))
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/environ.py", line 486, in meta_vars
    d.update(get_git_info(git_exe, git_dir, meta.config.debug))
  File "/home/reimar/miniconda3/lib/python3.9/site-packages/conda_build/environ.py", line 193, in get_git_info
    from conda._vendor.auxlib.packaging import _get_version_from_git_tag
ModuleNotFoundError: No module named 'conda._vendor.auxlib'
kkiesling commented 2 years ago

@ReimarBauer have you by chance figured out a solution? I am getting the exact same error when building a package locally on a brand new Mac operating system. Are you by chance also on MacOS? I can build the same package just fine on a linux OS, but it fails on MacOS (conda version 4.12.0 on both systems).

wolfv commented 2 years ago

@ReimarBauer @kkiesling the base env was not up to date. If you use conda build it uses the conda / conda-build from the base environment.

kkiesling commented 2 years ago

@wolfv - I install anaconda on a brand new computer on Monday (3 days ago). Even that base environment is not up to date?

EDIT: running conda update --all does appear to have many packages needing updates. We shall see if that corrects this issue.

EDIT 2: even after updating, building locally still results in the same error.

ReimarBauer commented 2 years ago

Solution for the following description was to update conda-build in the base environment

I added this in front of my question, to stop the next one to read the problem, doing the upgrade first solves it. It is always better to add a comment too.

Solution for my problem was to update conda-build in the base environment

ReimarBauer commented 2 years ago

@kkiesling please show the version of conda-build

(base) conda list conda-build
# packages in environment at /home/reimar/miniconda3:
#
# Name                    Version                   Build  Channel
conda-build               3.21.8           py39hf3d152e_0    conda-forge

Which version do you have ?

Do you get offered a newer one by explicit requesting?

conda update conda-build
kkiesling commented 2 years ago

@ReimarBauer - Updating conda-build explicitly did fix this. I was on 3.21.5 even after running conda update --all previously. But conda update conda-build brought it to 3.21.8 and it appears to work now. Thanks!

mirizarry-ortiz commented 2 years ago

@ReimarBauer so what are the steps to solve the issue? I did conda update conda-build and then conda update --all but the older version of mamba remained. I removed mamba and tried installing a newer version by explicitly doing conda install mamba=0.22.1 but it fails due to conflicts.

ReimarBauer commented 2 years ago

for me "conda update conda-build" was all to do. Try to force install to the newest version of conda-build.

mirizarry-ortiz commented 2 years ago

@ReimarBauer Thank you! I think I also have a conflict now with rstudio.

wolfv commented 2 years ago

@mirizarry-ortiz the recommendation is to keep the base environment clean with only conda & mamba installed. For everything else, it's best to create new environments, e.g. with mamba create -n rstudio rstudio ...

If you want to start clean, it's recommended to start with Miniforge / Mambaforge: https://github.com/conda-forge/miniforge

mirizarry-ortiz commented 2 years ago

@wolfv Thank you! I will try that!

prerakmody commented 2 years ago

I'm currently trying:

conda create -y -n newenv "python=3.8" "mamba>=0.22.1"

which seems to work.

I did the same, but had to add the conda-forge channel to the command.

conda create -y -n myenv "python=3.8" "mamba>=0.22.1" -c conda-forge conda activate myenv mamba list mamba

mathbunnyru commented 2 years ago

The same thing happens with micromamba: micromamba install --root-prefix=/opt/conda --prefix=/opt/conda --yes python=3.8 mamba notebook jupyterhub jupyterlab

Linking mamba-0.1.2-py38hbf85e49_0 So it installs old mamba version. Using mamba>=0.27.0 works though.

Is there a better way?

More details here: https://github.com/jupyter/docker-stacks/issues/1810#issue-1420778595

mathbunnyru commented 1 year ago

It seems to work fine now with mamba-1.0.0 and micromamba-1.0.0 🎉

jbdurand commented 1 year ago

As proposed by mathbunnyru , to solve the issue No module named 'conda._vendor.auxlib' in mamba from my environment called "default", I had to run

conda activate default
conda update conda-build
conda update mamba -c conda-forge

(just conda update mamba would not solve the issue)

GrigoriiTarasov commented 1 year ago

"Update conda build" not resolving for Anaconda3-2022.10-Windows-x86_64, linux-aarch64/conda-4.12.0-py38he3eb160_0.tar.bz2 if mamba=0.1.2 was installed priorly.