conda-forge / miniforge

A conda-forge distribution.
https://conda-forge.org/miniforge
Other
5.76k stars 306 forks source link

Miniforge uninstaller fails on Windows 11 #550

Open blazerzar opened 5 months ago

blazerzar commented 5 months ago

Solution to issue cannot be found in the documentation.

Issue

On my Windows 11 machine I tried installing Miniforge and make it work with Zsh in Git Bash. I got it working once using PYTHONIOENCODING set to utf8 inline, but after adding this variable to .zshenv, conda activate base never worked again. Due to this I decided to try reinstalling a different version.

When trying to uninstall Miniforge through Add or remove programs window, uninstaller fails and reports:

I tried running the uninstaller as Administrator from the file next. Now it reported only

This is the detailed output I got.

Deleting Miniforge3 menus...
Running pre_uninstall scripts...
Running rmpath scripts...
Traceback (most recent call last):
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 380, in <module>
    main()
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 369, in main
    remove_from_path()
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 255, in remove_from_path
    from _system_path import broadcast_environment_settings_change, remove_from_system_path
  File "C:\Users\Blaz\miniforge3\Lib\_system_path.py", line 11, in <module>
    import ctypes
  File "C:\Users\Blaz\miniforge3\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.
Error in sys.excepthook:
Traceback (most recent call last):
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 47, in gui_excepthook
    import ctypes
  File "C:\Users\Blaz\miniforge3\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.

Original exception was:
Traceback (most recent call last):
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 380, in <module>
    main()
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 369, in main
    remove_from_path()
  File "C:\Users\Blaz\miniforge3\Lib\_nsis.py", line 255, in remove_from_path
    from _system_path import broadcast_environment_settings_change, remove_from_system_path
  File "C:\Users\Blaz\miniforge3\Lib\_system_path.py", line 11, in <module>
    import ctypes
  File "C:\Users\Blaz\miniforge3\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: The specified module could not be found.
::error:: Failed to run rmpath
Running rmreg scripts...
Removing files and folders...
Completed

The installer did remove the install directory, but entry in Add or remove programs list remains.

Is there a fix for this or is there possible to fully remove Miniforge traces manually?

Installed packages

archspec                  0.2.2              pyhd8ed1ab_0    conda-forge
boltons                   23.1.1             pyhd8ed1ab_0    conda-forge
brotli-python             1.1.0           py310h00ffb61_1    conda-forge
bzip2                     1.0.8                hcfcfb64_5    conda-forge
ca-certificates           2023.11.17           h56e8100_0    conda-forge
certifi                   2023.11.17         pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py310h8d17308_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
conda                     23.11.0         py310h5588dad_1    conda-forge
conda-libmamba-solver     23.12.0            pyhd8ed1ab_0    conda-forge
conda-package-handling    2.2.0              pyh38be061_0    conda-forge
conda-package-streaming   0.9.0              pyhd8ed1ab_0    conda-forge
distro                    1.8.0              pyhd8ed1ab_0    conda-forge
fmt                       10.1.1               h181d51b_1    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py310h5588dad_3    conda-forge
krb5                      1.21.2               heb0366b_0    conda-forge
libarchive                3.7.2                h313118b_1    conda-forge
libcurl                   8.5.0                hd5e4a3a_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libiconv                  1.17                 hcfcfb64_2    conda-forge
libmamba                  1.5.5                h3f09ed1_0    conda-forge
libmambapy                1.5.5           py310h04f2035_0    conda-forge
libsolv                   0.7.27               h12be248_0    conda-forge
libsqlite                 3.44.2               hcfcfb64_0    conda-forge
libssh2                   1.11.0               h7dfc565_0    conda-forge
libxml2                   2.12.3               hc3477c8_0    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
lz4-c                     1.9.4                hcfcfb64_0    conda-forge
lzo                       2.10              he774522_1000    conda-forge
mamba                     1.5.5           py310hd9d798f_0    conda-forge
menuinst                  2.0.1           py310h00ffb61_0    conda-forge
miniforge_console_shortcut 1.0                  h57928b3_0    conda-forge
openssl                   3.2.0                hcfcfb64_1    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pip                       23.3.2             pyhd8ed1ab_0    conda-forge
platformdirs              4.1.0              pyhd8ed1ab_0    conda-forge
pluggy                    1.3.0              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.6           py310h8d17308_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyh0701188_6    conda-forge
python                    3.10.13         h4de0772_0_cpython    conda-forge
python_abi                3.10                    4_cp310    conda-forge
reproc                    14.2.4.post0         hcfcfb64_1    conda-forge
reproc-cpp                14.2.4.post0         h63175ca_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
ruamel.yaml               0.18.5          py310h8d17308_0    conda-forge
ruamel.yaml.clib          0.2.7           py310h8d17308_2    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h5226925_1    conda-forge
tqdm                      4.66.1             pyhd8ed1ab_0    conda-forge
truststore                0.8.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
urllib3                   2.1.0              pyhd8ed1ab_0    conda-forge
vc                        14.3                hcf57466_18    conda-forge
vc14_runtime              14.38.33130         h82b7239_18    conda-forge
vs2015_runtime            14.38.33130         hcb4865c_18    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0              pyhd8ed1ab_6    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
yaml-cpp                  0.8.0                h63175ca_0    conda-forge
zstandard                 0.22.0          py310h0009e47_0    conda-forge
zstd                      1.5.5                h12be248_0    conda-forge

Environment info

active environment : None
       user config file : C:\Users\Blaz\.condarc
 populated config files : C:\Users\Blaz\miniforge3\.condarc
                          C:\Users\Blaz\.condarc
          conda version : 23.11.0
    conda-build version : not installed
         python version : 3.10.13.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=x86_64
                          __conda=23.11.0=0
                          __cuda=12.2=0
                          __win=0=0
       base environment : C:\Users\Blaz\miniforge3  (writable)
      conda av data dir : C:\Users\Blaz\miniforge3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Users\Blaz\miniforge3\pkgs
                          C:\Users\Blaz\.conda\pkgs
                          C:\Users\Blaz\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\Blaz\miniforge3\envs
                          C:\Users\Blaz\.conda\envs
                          C:\Users\Blaz\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.11.0 requests/2.31.0 CPython/3.10.13 Windows/10 Windows/10.0.22631 solver/libmamba conda-libmamba-solver/23.12.0 libmambapy/1.5.5
          administrator : False
             netrc file : None
           offline mode : False
cngmid commented 4 months ago

I found a solution in https://stackoverflow.com/questions/73458524/importerror-dll-load-failed-while-importing-ctypes-the-specified-module-coul?rq=2

In my case the files ffi.dll and ffi-7.dll were missing in MINICONDA3\Library\bin. I found them in some packages running:

dir /B /S "pkgs\*ffi*.dll"

I copied the two missing ones over. After that conda was running again. Hope this helps.

ZhiyeTang commented 1 month ago

Encountered the same issue. Seems after 5 months this issue still remains open. Can anyone make some help?