无法更新Conda或 Python

编程语言 2026-07-10

我一直在尝试用最新版的conda和 Python来搭建一个新的conda环境。我的基础环境的Python版本是3.8.8,conda是 23.3.1,我想要Python 3.12和 conda 25.7。

我尝试了

conda create -n clean_env python=3.12

输出(下面我会粘贴)显示Python 3.12已经下载,然后又说正在下载和解压缩的软件包已完成。但当我激活环境时,仍然是在Python 3.8.8。我以为这可能是因为我的conda版本过时,当我尝试

conda install -c defaults conda=25.7.0,还是显示软件包已下载,但实际上并没有更新Conda的版本。(我会粘贴输出)

有人对如何解决有何想法?我应该使用miniconda吗?谢谢!

conda create -n clean_env python=3.12

Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 23.3.1
  latest version: 25.7.0

Please update conda by running

    $ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

     conda install conda=25.7.0



## Package Plan ##

  environment location: /Users/molliepassacantando/opt/anaconda3/envs/clean_env

  added / updated specs:
    - python=3.12


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    python-3.12.11             |       he8d2d4c_0        14.0 MB
    setuptools-78.1.1          |  py312hecd8cb5_0         2.2 MB
    wheel-0.45.1               |  py312hecd8cb5_0         151 KB
    ------------------------------------------------------------
                                           Total:        16.4 MB

The following NEW packages will be INSTALLED:

  bzip2              pkgs/main/osx-64::bzip2-1.0.8-h6c40b1e_6 
  ca-certificates    pkgs/main/osx-64::ca-certificates-2025.7.15-hecd8cb5_0 
  expat              pkgs/main/osx-64::expat-2.7.1-h6d0c2b6_0 
  libcxx             pkgs/main/osx-64::libcxx-19.1.7-haebbb44_3 
  libffi             pkgs/main/osx-64::libffi-3.4.4-hecd8cb5_1 
  ncurses            pkgs/main/osx-64::ncurses-6.5-h923df54_0 
  openssl            pkgs/main/osx-64::openssl-3.0.17-hee2dfae_0 
  pip                pkgs/main/noarch::pip-26.0.1-pyhc872135_0 
  python             pkgs/main/osx-64::python-3.12.11-he8d2d4c_0 
  readline           pkgs/main/osx-64::readline-8.3-h49f2429_0 
  setuptools         pkgs/main/osx-64::setuptools-78.1.1-py312hecd8cb5_0 
  sqlite             pkgs/main/osx-64::sqlite-3.50.2-hc8b0dd6_1 
  tk                 pkgs/main/osx-64::tk-8.6.15-h3a5a201_0 
  tzdata             pkgs/main/noarch::tzdata-2026a-he532380_0 
  wheel              pkgs/main/osx-64::wheel-0.45.1-py312hecd8cb5_0 
  xz                 pkgs/main/osx-64::xz-5.6.4-h46256e1_1 
  zlib               pkgs/main/osx-64::zlib-1.2.13-h4b97444_1 


Proceed ([y]/n)? y


Downloading and Extracting Packages

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

conda install -c defaults conda=25.7.0

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 23.3.1
  latest version: 25.7.0

Please update conda by running

    $ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

     conda install conda=25.7.0



## Package Plan ##

  environment location: /Users/molliepassacantando/opt/anaconda3/envs/clean_env

  added / updated specs:
    - conda=25.7.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    archspec-0.2.5             |     pyhd3eb1b0_0          48 KB
    boltons-25.0.0             |  py312hecd8cb5_0         496 KB
    brotlicffi-1.0.9.2         |  py312h6d0c2b6_1         393 KB
    certifi-2025.8.3           |  py312hecd8cb5_0         161 KB
    cffi-1.17.1                |  py312h9205ec4_1         292 KB
    conda-25.7.0               |  py312hecd8cb5_0         1.2 MB
    conda-libmamba-solver-25.4.0|     pyhdf14ebd_1          39 KB
    conda-package-handling-2.4.0|  py312hecd8cb5_0         283 KB
    conda-package-streaming-0.12.0|  py312hecd8cb5_0          40 KB
    cpp-expected-1.1.0         |       h1962661_0         131 KB
    distro-1.9.0               |  py312hecd8cb5_0          37 KB
    fmt-9.1.0                  |       ha357a0b_1         187 KB
    frozendict-2.4.2           |  py312hecd8cb5_0          38 KB
    idna-3.7                   |  py312hecd8cb5_0         133 KB
    jsonpatch-1.33             |  py312hecd8cb5_1          37 KB
    jsonpointer-3.0.0          |  py312hecd8cb5_0          22 KB
    libarchive-3.7.7           |       h4c66a04_0         801 KB
    libmamba-2.0.5             |       hfd235c6_1         1.6 MB
    libmambapy-2.0.5           |  py312h1962661_1         645 KB
    libsolv-0.7.30             |       h2761308_1         442 KB
    menuinst-2.3.1             |  py312hecd8cb5_0         262 KB
    nlohmann_json-3.11.2       |       hcec6c5f_0         126 KB
    packaging-25.0             |  py312hecd8cb5_0         203 KB
    platformdirs-4.3.7         |  py312hecd8cb5_0          42 KB
    pluggy-1.5.0               |  py312hecd8cb5_0          47 KB
    pybind11-abi-5             |       hd3eb1b0_0          14 KB
    pycosat-0.6.6              |  py312h46256e1_2          92 KB
    pysocks-1.7.1              |  py312hecd8cb5_0          34 KB
    reproc-14.2.4              |       hcec6c5f_2          28 KB
    reproc-cpp-14.2.4          |       hcec6c5f_2          20 KB
    requests-2.32.4            |  py312hecd8cb5_0         176 KB
    ruamel.yaml-0.18.10        |  py312h46256e1_0         273 KB
    ruamel.yaml.clib-0.2.12    |  py312h46256e1_0         143 KB
    simdjson-3.10.1            |       h1962661_0         245 KB
    spdlog-1.11.0              |       ha357a0b_0         211 KB
    tqdm-4.67.1                |  py312h8e4b320_0         160 KB
    truststore-0.10.1          |  py312hecd8cb5_0          51 KB
    urllib3-2.5.0              |  py312hecd8cb5_0         352 KB
    yaml-cpp-0.8.0             |       hcec6c5f_1         487 KB
    zstandard-0.23.0           |  py312h5bcdf72_1         456 KB
    ------------------------------------------------------------
                                           Total:        10.2 MB

The following NEW packages will be INSTALLED:

  archspec           pkgs/main/noarch::archspec-0.2.5-pyhd3eb1b0_0 
  boltons            pkgs/main/osx-64::boltons-25.0.0-py312hecd8cb5_0 
  brotlicffi         pkgs/main/osx-64::brotlicffi-1.0.9.2-py312h6d0c2b6_1 
  c-ares             pkgs/main/osx-64::c-ares-1.19.1-h6c40b1e_0 
  certifi            pkgs/main/osx-64::certifi-2025.8.3-py312hecd8cb5_0 
  cffi               pkgs/main/osx-64::cffi-1.17.1-py312h9205ec4_1 
  charset-normalizer pkgs/main/noarch::charset-normalizer-3.3.2-pyhd3eb1b0_0 
  conda              pkgs/main/osx-64::conda-25.7.0-py312hecd8cb5_0 
  conda-libmamba-so~ pkgs/main/noarch::conda-libmamba-solver-25.4.0-pyhdf14ebd_1 
  conda-package-han~ pkgs/main/osx-64::conda-package-handling-2.4.0-py312hecd8cb5_0 
  conda-package-str~ pkgs/main/osx-64::conda-package-streaming-0.12.0-py312hecd8cb5_0 
  cpp-expected       pkgs/main/osx-64::cpp-expected-1.1.0-h1962661_0 
  distro             pkgs/main/osx-64::distro-1.9.0-py312hecd8cb5_0 
  fmt                pkgs/main/osx-64::fmt-9.1.0-ha357a0b_1 
  frozendict         pkgs/main/osx-64::frozendict-2.4.2-py312hecd8cb5_0 
  icu                pkgs/main/osx-64::icu-73.1-hcec6c5f_0 
  idna               pkgs/main/osx-64::idna-3.7-py312hecd8cb5_0 
  jsonpatch          pkgs/main/osx-64::jsonpatch-1.33-py312hecd8cb5_1 
  jsonpointer        pkgs/main/osx-64::jsonpointer-3.0.0-py312hecd8cb5_0 
  libarchive         pkgs/main/osx-64::libarchive-3.7.7-h4c66a04_0 
  libcurl            pkgs/main/osx-64::libcurl-8.14.1-h1448931_1 
  libev              pkgs/main/osx-64::libev-4.33-h9ed2024_1 
  libiconv           pkgs/main/osx-64::libiconv-1.16-h6c40b1e_3 
  libmamba           pkgs/main/osx-64::libmamba-2.0.5-hfd235c6_1 
  libmambapy         pkgs/main/osx-64::libmambapy-2.0.5-py312h1962661_1 
  libnghttp2         pkgs/main/osx-64::libnghttp2-1.57.0-h9beae6a_0 
  libsolv            pkgs/main/osx-64::libsolv-0.7.30-h2761308_1 
  libssh2            pkgs/main/osx-64::libssh2-1.11.1-h3a17b82_0 
  libxml2            pkgs/main/osx-64::libxml2-2.13.8-h6070cd6_0 
  lz4-c              pkgs/main/osx-64::lz4-c-1.9.4-hcec6c5f_1 
  menuinst           pkgs/main/osx-64::menuinst-2.3.1-py312hecd8cb5_0 
  nlohmann_json      pkgs/main/osx-64::nlohmann_json-3.11.2-hcec6c5f_0 
  packaging          pkgs/main/osx-64::packaging-25.0-py312hecd8cb5_0 
  pcre2              pkgs/main/osx-64::pcre2-10.42-h9b97e30_1 
  platformdirs       pkgs/main/osx-64::platformdirs-4.3.7-py312hecd8cb5_0 
  pluggy             pkgs/main/osx-64::pluggy-1.5.0-py312hecd8cb5_0 
  pybind11-abi       pkgs/main/noarch::pybind11-abi-5-hd3eb1b0_0 
  pycosat            pkgs/main/osx-64::pycosat-0.6.6-py312h46256e1_2 
  pycparser          pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0 
  pysocks            pkgs/main/osx-64::pysocks-1.7.1-py312hecd8cb5_0 
  reproc             pkgs/main/osx-64::reproc-14.2.4-hcec6c5f_2 
  reproc-cpp         pkgs/main/osx-64::reproc-cpp-14.2.4-hcec6c5f_2 
  requests           pkgs/main/osx-64::requests-2.32.4-py312hecd8cb5_0 
  ruamel.yaml        pkgs/main/osx-64::ruamel.yaml-0.18.10-py312h46256e1_0 
  ruamel.yaml.clib   pkgs/main/osx-64::ruamel.yaml.clib-0.2.12-py312h46256e1_0 
  simdjson           pkgs/main/osx-64::simdjson-3.10.1-h1962661_0 
  spdlog             pkgs/main/osx-64::spdlog-1.11.0-ha357a0b_0 
  tqdm               pkgs/main/osx-64::tqdm-4.67.1-py312h8e4b320_0 
  truststore         pkgs/main/osx-64::truststore-0.10.1-py312hecd8cb5_0 
  urllib3            pkgs/main/osx-64::urllib3-2.5.0-py312hecd8cb5_0 
  yaml-cpp           pkgs/main/osx-64::yaml-cpp-0.8.0-hcec6c5f_1 
  zstandard          pkgs/main/osx-64::zstandard-0.23.0-py312h5bcdf72_1 
  zstd               pkgs/main/osx-64::zstd-1.5.6-h138b38a_0 


Proceed ([y]/n)? y


Downloading and Extracting Packages

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

解决方案

Your clean_env was created correctly with Python 3.12. The package plan shows python-3.12.11 being installed into that environment, and your later which python output confirms the env’s Python is being used now. The original Python issue was just that the shell hadn’t been initialized for Conda yet, so conda init fixed activation.

The Conda version is a different issue: you ran conda install conda=25.7.0 while clean_env was active, so that installed Conda into clean_env, not into the base installation that provides the conda command you normally run. Conda’s docs recommend updating Conda in the base environment:

conda activate base
conda update conda

or:

conda update -n base -c defaults conda

Then check:

which conda
conda --version

If which conda still points somewhere unexpected, that would mean you still have a PATH/shell init issue rather than a package install problem.

站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。

相关文章