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

mamba remove package doesn't respect --force flag #412

dhirschfeld opened this issue Jul 18, 2020 · 8 comments

mamba remove package doesn't respect --force flag #412

dhirschfeld opened this issue Jul 18, 2020 · 8 comments


Copy link

Or has different (IMHO undesirable) behaviour from conda.

With conda the --force flag allows you to remove a package without uninstalling every package which depends on it - e.g.

> conda remove --force numpy

## Package Plan ##

  environment location: C:\Users\dhirschf\envs\dev

  removed specs:
    - numpy

The following packages will be REMOVED:


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Whilst it will leave your environment in an inconsistent state, IMHO if you use --force it's up to you to deal with the consequences. This can be very useful in cases where you e.g. want to use a develop/editable install.

In any case, trying the same with mamba basically wants to uninstall the entire environment:

> mamba remove --force numpy

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (0.4.2) supported by @QuantStack



Removing specs: ['numpy']

  Prefix: C:\Users\dhirschf\envs\dev

  Removing specs:

   - numpy

  Package               Version  Build                   Channel       Size

  algopy                  0.5.7  py_0                    installed
  altair                  4.1.0  py_1                    installed
  arrow-cpp              0.17.1  py37h1234567_10_cpu     installed
  arviz                   0.9.0  py_0                    installed
  astropy           4.0.1.post1  py37h8055547_0          installed
  autograd                  1.3  py_0                    installed
  bokeh                   2.1.1  py37hc8dfbb8_0          installed
  bottleneck              1.3.2  py37hbc2f12b_1          installed
  catboost               0.23.2  py37hc8dfbb8_0          installed
  cftime                  1.2.0  py37h44b1f71_1          installed
  chainer                 7.4.0  py_0                    installed
  cython-blis             0.4.1  py37h8055547_1          installed
  dask                   2.20.0  py_0                    installed
  dask-glm                0.2.0  py_1                    installed
  dask-ml                 1.5.0  py_0                    installed
  datashader             0.10.0  py_0                    installed
  datashape               0.5.4  py_1                    installed
  deap                    1.3.1  py37h9b59f54_1          installed
  fletcher                0.5.0  pyh9f0ad1d_1            installed
  h5py                   2.10.0  nompi_py37hde23a51_103  installed
  holoviews              1.13.3  pyh9f0ad1d_0            installed
  hvplot                  0.6.0  pyh9f0ad1d_0            installed
  ibis-framework         0.14.0  py37_0                  installed
  imagecodecs         2020.5.30  py37h92c78e3_2          installed
  imageio                 2.9.0  py_0                    installed
  ipympl                  0.5.6  pyh9f0ad1d_1            installed
  lightgbm                2.3.1  py37h6538335_0          installed
  matplotlib              3.2.2  1                       installed
  matplotlib-base         3.2.2  py37hab8957c_1          installed
  mkl_fft                1.0.15  py37h14836fe_0          installed
  mkl_random              1.1.0  py37h675688f_0          installed
  mlxtend                0.17.2  py_0                    installed
  netcdf4                 1.5.3  nompi_py37he83aa3c_105  installed
  numba                  0.50.1  py37h3bbf574_0          installed
  numcodecs               0.6.4  py37h6538335_0          installed
  numdifftools           0.9.39  py_0                    installed
  numexpr                 2.7.1  py37h25d0782_0          installed
  numpy                  1.18.4  py37hae9e721_0          installed
  opencv                  4.3.0  py37_2                  installed
  opt_einsum              3.2.1  py_0                    installed
  pandas                  1.0.5  py37h3bbf574_0          installed
  panel                   0.9.7  py_0                    installed
  parquet-cpp             1.5.1  2                       installed
  patsy                   0.5.1  py_0                    installed
  pomegranate            0.13.3  py37h1fb7aa8_0          installed
  py-opencv               4.3.0  py37h43977f1_2          installed
  py-xgboost               0.90  py37_1                  installed
  pyarrow                0.17.1  py37h1234567_10_cpu     installed
  pygpu                   0.7.6  py37h44b1f71_1001       installed
  pymc3                   3.9.2  py_0                    installed
  pytables                3.6.1  py37h2d87964_2          installed
  python-cufflinks       0.17.3  py_0                    installed
  python-hdfs             2.5.8  py_0                    installed
  pytorch-cpu             1.1.0  py37ha925a31_0          installed
  pywavelets              1.1.1  py37h44b1f71_1          installed
  quandl                  3.5.0  py37_0                  installed
  scikit-image           0.17.2  py37h3bbf574_1          installed
  scikit-learn           0.23.1  py37ha0ab79d_0          installed
  scikit-optimize         0.7.4  py_0                    installed
  scipy                   1.4.1  py37h9439919_0          installed
  seaborn                0.10.1  1                       installed
  seaborn-base           0.10.1  py_1                    installed
  skorch                  0.8.0  pyh5ca1d4c_0            installed
  spacy                   2.3.1  py37h1fb7aa8_0          installed
  statsmodels            0.11.1  py37h4ab8f01_2          installed
  theano                  1.0.4  py37h1834ac0_1002       installed
  thinc                   7.4.1  py37h1fb7aa8_0          installed
  tifffile             2020.7.4  py_0                    installed
  torchvision-cpu         0.3.0  py37_cuNone_1           installed
  tpot                   0.11.5  pyh9f0ad1d_0            installed
  turbodbc                4.1.1  py37h47af31f_0          installed
  umap-learn              0.4.6  py37hc8dfbb8_0          installed
  xarray                 0.16.0  py_0                    installed
  zarr                    2.4.0  py_0                    installed


  Remove: 74 packages

  Total download: 0  B


Confirm changes: [Y/n] n
Copy link

My workaround at the moment is to install conda in the environment, and to use that for the --force uninstall:

mamba activate $MY_ENV
mamba install conda -c defaults --yes
conda remove --force $OFFENDING_PACKAGE

But ideally mamba will be able to do that soon :)

@wolfv wolfv added this to the 0.8.1 milestone Mar 3, 2021
@wolfv wolfv modified the milestones: 0.8.1, 0.8.x Mar 22, 2021
Copy link

wolfv commented Mar 22, 2021

I have been giving this some thought and it will require us to re-engineer slightly our current "Transaction" class to be able to handle "explicit" transactions as well.

Explicit transactions will not go through the solver, but rather either use URLs / files or the forced removal of an installed spec.

Having this would also be nice so that we can consolidate our current micromamba explicit environmetn file handling.

Copy link

+1 for this

bdice added a commit to bdice/cudf that referenced this issue Jan 6, 2022
Co-authored-by: AJ Schmidt <>
Copy link

Closing this as recent discussion is in #1523

@jonashaag jonashaag closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2022
Copy link

So the plan is to always have the mamba api differ from conda here? If so I think we need to have mamba error if people try the command.

Copy link

I just meant to say we should continue discussing in the other ticket.

Copy link

If I “close as duplicate” in GitHub it days “closed as not planned” which doesn’t make sense

Copy link

Ahhhhh got it. Great and thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

6 participants