Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Namespace' object has no attribute 'func' #475

Closed
1 task done
breengles opened this issue Jul 28, 2023 · 11 comments
Closed
1 task done

'Namespace' object has no attribute 'func' #475

breengles opened this issue Jul 28, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@breengles
Copy link

breengles commented Jul 28, 2023

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

After fresh installation of mambaforge for Linux x86_64 and running mamba update --all -y, I get the following error when try to run mamba env <what ever command>, e.g., for mamba env --help (though conda env --help works just fine):

'Namespace' object has no attribute 'func'

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/artem/mambaforge/lib/python3.10/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
      File "/home/artem/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 926, in exception_converter
        raise e
      File "/home/artem/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 919, in exception_converter
        exit_code = _wrapped_main(*args, **kwargs)
      File "/home/artem/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 877, in _wrapped_main
        result = do_call(parsed_args, p)
      File "/home/artem/mambaforge/lib/python3.10/site-packages/mamba/mamba.py", line 709, in do_call
        relative_mod, func_name = args.func.rsplit(".", 1)
    AttributeError: 'Namespace' object has no attribute 'func'

`$ /home/artem/mambaforge/bin/mamba env --help`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/home/artem/mambaforge/bin/conda
             CONDA_PREFIX=/home/artem/mambaforge
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/home/artem/mambaforge/bin/python
               CONDA_ROOT=/home/artem/mambaforge
              CONDA_SHLVL=1
           CURL_CA_BUNDLE=<not set>
               LD_PRELOAD=<not set>
                     PATH=/home/artem/mambaforge/bin:/home/artem/mambaforge/condabin:/home/artem
                          /.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/b
                          in:/usr/games:/usr/local/games:/snap/bin:/snap/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>
               WINDOWPATH=2

     active environment : base
    active env location : /home/artem/mambaforge
            shell level : 1
       user config file : /home/artem/.condarc
 populated config files : /home/artem/mambaforge/.condarc
          conda version : 23.7.1
    conda-build version : not installed
         python version : 3.10.12.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=12.2=0
                          __glibc=2.35=0
                          __linux=5.19.0=0
                          __unix=0=0
       base environment : /home/artem/mambaforge  (writable)
      conda av data dir : /home/artem/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/artem/mambaforge/pkgs
                          /home/artem/.conda/pkgs
       envs directories : /home/artem/mambaforge/envs
                          /home/artem/.conda/envs
               platform : linux-64
             user-agent : conda/23.7.1 requests/2.31.0 CPython/3.10.12 Linux/5.19.0-50-generic ubuntu/22.04.2 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install <package>

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install <package>

Installed packages

# packages in environment at /home/artem/mambaforge:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
brotli-python             1.0.9           py310hd8f1fbe_9    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.19.1               hd590300_0    conda-forge
ca-certificates           2023.7.22            hbcca054_0    conda-forge
certifi                   2023.7.22          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310h255011f_3    conda-forge
charset-normalizer        3.2.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.7.1          py310hff52083_0    conda-forge
conda-package-handling    2.0.2              pyh38be061_0    conda-forge
conda-package-streaming   0.8.0              pyhd8ed1ab_0    conda-forge
cryptography              41.0.2          py310h75e40e8_0    conda-forge
fmt                       9.1.0                h924138e_0    conda-forge
icu                       72.1                 hcb278e6_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
jsonpatch                 1.32               pyhd8ed1ab_0    conda-forge
jsonpointer               2.0                        py_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.1               h659d440_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
libarchive                3.6.2                h039dbb9_1    conda-forge
libcurl                   8.2.1                hca28451_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 h516909a_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.1.0               he5830b7_0    conda-forge
libgomp                   13.1.0               he5830b7_0    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libmamba                  1.4.9                h658169a_0    conda-forge
libmambapy                1.4.9           py310h8aae740_0    conda-forge
libnghttp2                1.52.0               h61bc06f_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libsolv                   0.7.24               hfc55251_1    conda-forge
libsqlite                 3.42.0               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.1.0               hfd8a6a1_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxml2                   2.11.4               h0d562d8_0    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mamba                     1.4.9           py310h51d5547_0    conda-forge
ncurses                   6.4                  hcb278e6_0    conda-forge
openssl                   3.1.1                hd590300_1    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pip                       23.2.1             pyhd8ed1ab_0    conda-forge
pluggy                    1.2.0              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.4           py310h5764c6d_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.10.12         hd12c33a_0_cpython    conda-forge
python_abi                3.10                    3_cp310    conda-forge
readline                  8.2                  h8228510_1    conda-forge
reproc                    14.2.4               h0b41bf4_0    conda-forge
reproc-cpp                14.2.4               hcb278e6_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
ruamel.yaml               0.17.32         py310h2372a71_0    conda-forge
ruamel.yaml.clib          0.2.7           py310h1fa729e_1    conda-forge
setuptools                68.0.0             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
urllib3                   2.0.4              pyhd8ed1ab_0    conda-forge
wheel                     0.41.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml-cpp                  0.7.0                h27087fc_2    conda-forge
zstandard                 0.19.0          py310h1275a96_2    conda-forge
zstd                      1.5.2                hfc55251_7    conda-forge

Environment info

active environment : base
    active env location : /home/artem/mambaforge
            shell level : 1
       user config file : /home/artem/.condarc
 populated config files : /home/artem/mambaforge/.condarc
          conda version : 23.7.1
    conda-build version : not installed
         python version : 3.10.12.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=12.2=0
                          __glibc=2.35=0
                          __linux=5.19.0=0
                          __unix=0=0
       base environment : /home/artem/mambaforge  (writable)
      conda av data dir : /home/artem/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/artem/mambaforge/pkgs
                          /home/artem/.conda/pkgs
       envs directories : /home/artem/mambaforge/envs
                          /home/artem/.conda/envs
               platform : linux-64
             user-agent : conda/23.7.1 requests/2.31.0 CPython/3.10.12 Linux/5.19.0-50-generic ubuntu/22.04.2 glibc/2.35
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
@breengles breengles added the bug Something isn't working label Jul 28, 2023
@jaimergp
Copy link
Member

Looks like an incompatibility with the new conda 23.7.x series and the current mamba. You might need to report this to mamba-org/mamba.

The installation itself worked before the update, right?

@breengles
Copy link
Author

Hi @jaimergp!
Yep, the installation worked just fine. I think the issue appeared today (or quite recently as I think).
I will open an issue there and mention this one

@jtabox
Copy link

jtabox commented Aug 3, 2023

Can confirm, have had fully working installation but updated everything today and since then I'm getting the exact same error.

@mikofski
Copy link
Member

mikofski commented Aug 5, 2023

Interesting, so I used mamba to downgrade conda to 23.5.2 and now it works again. Can you please let us know when it's working again? thanks!

BTW: since downgrading conda, now in any env other than base, I get this after any command:

Could not load conda plugin `conda-build`:

argument of type 'NoneType' is not iterable

but my base env does have conda-build version-23.5.2, same as conda. Weird

@jaimergp
Copy link
Member

jaimergp commented Aug 6, 2023

The PR in mamba-org/mamba has been merged, so it's a matter of waiting for a new release on their end.

@corneliusroemer
Copy link
Member

Thanks for reporting and figuring out a workaround. To make it more findable, I've made a Stackoverflow Q&A: https://stackoverflow.com/questions/76847652/mamba-env-throws-attributeerror-namespace-object-has-no-attribute-func/76847653#76847653

@shermansiu
Copy link

shermansiu commented Aug 16, 2023

I didn't want to wait, so I applied Jaime's bug fix to my local copy of mamba.py... Took me about 2 minutes. 😅

@shermansiu
Copy link

shermansiu commented Aug 19, 2023

The relevant issue on Mamba's end is mamba-org/mamba#2715. Finding that issue is harder on Google compared to this issue as of this moment (which is now the first search result), so I'm including it here for convenience's sake. (...Which I suppose was also linked in the StackOverFlow post)

@mfisher87
Copy link
Member

mfisher87 commented Aug 20, 2023

Just ran in to this. Worth noting that while the issue on mamba-org is closed, the fix has not yet been released. The current latest version 1.4.9, released over a month ago, is impacted!

EDIT: Wanted to stress that with "released over a month ago", I only mean "the latest version is impacted because it occurred before this fix, not because the problem has regressed". I realized it kind of comes off as "jeez, release already!" :) ❤️

@shermansiu
Copy link

Thanks to Cornelius, we just got a new release of mamba 3 hours ago. The fix is out in mamba version 1.5.0!

(Feel free to close this issue).

@jaimergp
Copy link
Member

Noice! I'll close. Feel free to comment / reopen if you experience any issues with the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

7 participants