[Python] Tried to update conda, now I've ruined my base env

Discussão em 'Python' iniciado por Stack, Abril 4, 2025.

  1. Stack

    Stack Membro Participativo

    I am using windows 11, Intel(R) Xeon(R) Gold 5215 CPU.

    I tried to update fiona in my python 3.12 environment and was told to update conda, but following the conda instructions just resulted in the same prompt to update conda, with the same instructions:

    (p312) C:\Users\wesk>conda update fiona
    Channels:
    - conda-forge
    Platform: win-64
    Collecting package metadata (repodata.json): done
    Solving environment: done


    ==> WARNING: A newer version of conda exists. <==
    current version: 24.11.3
    latest version: 25.3.1

    Please update conda by running

    $ conda update -n base -c conda-forge conda



    # All requested packages already installed.


    (p312) C:\Users\wesk>conda update -n base -c conda-forge conda
    Channels:
    - conda-forge
    Platform: win-64
    Collecting package metadata (repodata.json): done
    Solving environment: done


    ==> WARNING: A newer version of conda exists. <==
    current version: 24.11.3
    latest version: 25.3.1

    Please update conda by running

    $ conda update -n base -c conda-forge conda



    # All requested packages already installed.


    I found a suggestion on stackoverflow to do conda update python which seems to have ruined everything! Not recommended:

    (base) C:\Users\wesk>conda update python
    Channels:
    - conda-forge
    Platform: win-64
    Collecting package metadata (repodata.json): done
    Solving environment: done


    ==> WARNING: A newer version of conda exists. <==
    current version: 24.11.3
    latest version: 25.3.1

    Please update conda by running

    $ conda update -n base -c conda-forge conda



    ## Package Plan ##

    environment location: C:\Users\wesk\AppData\Local\miniforge3

    added / updated specs:
    - python


    The following packages will be downloaded:

    package | build
    ---------------------------|-----------------
    liblzma-5.8.1 | h2466b09_0 102 KB conda-forge
    libsqlite-3.49.1 | h67fdade_2 1.0 MB conda-forge
    python-3.12.9 |h3f84c4b_1_cpython 15.2 MB conda-forge
    ------------------------------------------------------------
    Total: 16.3 MB

    The following packages will be UPDATED:

    liblzma 5.6.3-h2466b09_1 --> 5.8.1-h2466b09_0
    libsqlite 3.48.0-h67fdade_0 --> 3.49.1-h67fdade_2
    python 3.12.8-h3f84c4b_1_cpython --> 3.12.9-h3f84c4b_1_cpython


    Proceed ([y]/n)? y


    Downloading and Extracting Packages:

    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    Traceback (most recent call last):
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\exception_handler.py", line 18, in __call__
    return func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\cli\main.py", line 73, in main_sourced
    from ..base.context import context
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\base\context.py", line 32, in <module>
    from ..common._os.linux import linux_get_libc_version
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\common\_os\__init__.py", line 8, in <module>
    from .windows import get_free_space_on_windows as get_free_space
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\common\_os\windows.py", line 11, in <module>
    from ctypes import (
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
    ImportError: DLL load failed while importing _ctypes: The specified procedure could not be found.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\wesk\AppData\Local\miniforge3\Scripts\conda-script.py", line 12, in <module>
    sys.exit(main())
    ^^^^^^
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\cli\main.py", line 105, in main
    return conda_exception_handler(main, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\exception_handler.py", line 386, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\exception_handler.py", line 21, in __call__
    return self.handle_exception(exc_val, exc_tb)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\exception_handler.py", line 52, in handle_exception
    from .exceptions import (
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\exceptions.py", line 31, in <module>
    from .models.channel import Channel
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\models\channel.py", line 26, in <module>
    from ..base.context import context
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\base\context.py", line 32, in <module>
    from ..common._os.linux import linux_get_libc_version
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\common\_os\__init__.py", line 8, in <module>
    from .windows import get_free_space_on_windows as get_free_space
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\site-packages\conda\common\_os\windows.py", line 11, in <module>
    from ctypes import (
    File "C:\Users\wesk\AppData\Local\miniforge3\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
    ImportError: DLL load failed while importing _ctypes: The specified procedure could not be found.


    Now I can't seem to do anything: can't activate other environments, can't do conda list, etc. Where to I go from here, now that I have apparently screwed up everything?

    Cheers

    Continue reading...

Compartilhe esta Página