[2015-08-10] python021

本文介绍Python中的运算符重载技术,解释如何通过特殊方法实现类的行为类似于内置类型,涵盖加法、乘法等操作符重载,以及如何通过特殊方法模拟标准类型。

运算符重载

  • 运算符重载是指在方法中拦截内置的操作–当类的实例出现在内置操作中,Python会自动调用自定义的方法,并且返回自定义方法的操作结果
    • 运算符重载让类拦截常规的Python运算
      • 类可重载所有Python表达式云算符
      • 类也可重载打印、函数调用、属性点号运算等内置运算
    • 重载使类实例的行为像内置类型
    • 重载通过提供特殊名称的类方法实现
  • 运算符重载并非必须,并且通常也不是默认的
  • 除了_ _ init _ _ 和 _ _ del _ _ 之外,python类支持使用许多的特殊方法
    • 特殊方法都以双下划线开头和结尾,有些特殊方法有默认行为,没有默认行为的为了留到需要的时候再实现
    • 这些特殊方法是Python中用来扩充类的强大工具,它们可以实现:
      模拟标准类型
      重载操作符
    • 特殊方法允许类通过重载标准操作符+,*,甚至包括分段下标及映射操作[]来模拟标准类型

可调用对象有:call()

  • 函数

    • 内置函数
    • 自定义函数
      • def
      • lambda
  • 类方法

函数的属性:
        __doc__
        __name__
        __dict__
        __code__
        __globals__
方法:
    实例方法:绑定方法
    类方法:非绑定方法 
    静态方法

方法的属性:
    __doc__
    __name__
    __class__  :方法所属的类
    __func__   :实现该方法的函数对象
    __self__   :调用此方法的实例
内置函数:
    __doc__
    __name__
    __self__
类: 
    __doc__
    __name__
    __bases__
    __dict__
    __module__    :定义了当前类的模块名称
实例:
    __class__
    __dict__
对象都有特殊方法:
    __init__
    __new__
    __del__
    __dir__()
    __add__()
    __ge__()
haoge@DESKTOP-3UM43SH:~$ bash Miniconda3-latest-Linux-x86_64.sh Welcome to Miniconda3 py313_25.7.0-2 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>> source ~/.bashrc MINICONDA END USER LICENSE AGREEMENT Copyright Notice: Miniconda(R) (C) 2015, Anaconda, Inc. All rights reserved. Miniconda(R) is licensed, not sold. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followi ng conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disc laimer; 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following d isclaimer in the documentation and/or other materials provided with the distribution; 3. The name Anaconda, Inc. or Miniconda(R) may not be used to endorse or promote products derived from this software wit hout specific prior written permission from Anaconda, Inc.; and 4. Miniconda(R) may not be used to access or allow third parties to access Anaconda package repositories if such use wou ld circumvent paid licensing requirements or is otherwise restricted by the Anaconda Terms of Service. DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ANACONDA "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMI TED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE , AND NON-INFRINGEMENT ARE DISCLAIME D. IN NO EVENT SHALL ANACONDA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAG ES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINE SS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDIN G NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF MINICONDA(R), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Do you accept the license terms? [yes|no] >>> yes Miniconda3 will now be installed into this location: /home/haoge/miniconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/home/haoge/miniconda3] >>> PREFIX=/home/haoge/miniconda3 Unpacking bootstrapper... Unpacking payload... Installing base environment... Downloading and Extracting Packages: ## Package Plan ## environment location: /home/haoge/miniconda3 added / updated specs: - defaults/linux-64::_libgcc_mutex==0.1=main[md5=c3473ff8bdb3d124ed5ff11ec380d6f9] - defaults/linux-64::_openmp_mutex==5.1=1_gnu[md5=71d281e9c2192cb3fa425655a8defb85] - defaults/linux-64::anaconda-anon-usage==0.7.2=py313hfc0e8ea_100[md5=c6ea2f8456510ea049a5f05fead4b9b1] - defaults/linux-64::anaconda-auth==0.8.6=py313h06a4308_0[md5=1b575dad8e7084c59cfd8f8c4a2bd421] - defaults/linux-64::anaconda-cli-base==0.5.2=py313h06a4308_0[md5=d629fb0a0282b3adcf8f53ab82b63ad4] - defaults/linux-64::annotated-types==0.6.0=py313h06a4308_0[md5=4dc276db59e14eaf187426b0040eb209] - defaults/linux-64::boltons==25.0.0=py313h06a4308_0[md5=afd30cc40ab0edf4e246b901c8eca725] - defaults/linux-64::brotlicffi==1.0.9.2=py313h6a678d5_1[md5=256e218354e6ffcd32269368b5b9590d] - defaults/linux-64::bzip2==1.0.8=h5eee18b_6[md5=f21a3ff51c1b271977f53ce956a69297] - defaults/linux-64::c-ares==1.34.5=hef5626c_0[md5=4a0059c416e26b3c5e8a8fdf11dfa811] - defaults/linux-64::ca-certificates==2025.7.15=h06a4308_0[md5=a65eaddc4f9529b9c908f544ca50e7e0] - defaults/linux-64::certifi==2025.8.3=py313h06a4308_0[md5=1d24ffefc1375c97ae5c5175235aa724] - defaults/linux-64::cffi==1.17.1=py313h1fdaa30_1[md5=c5d4f727e7bccd4bd8d599e049853383] - defaults/linux-64::click==8.2.1=py313h06a4308_0[md5=a4fe8d908fee44662a5667b40506cba5] - defaults/linux-64::colorama==0.4.6=py313h06a4308_0[md5=9c0c672e71bd0523bdaa9376ea056ebd] - defaults/linux-64::conda-anaconda-tos==0.2.2=py313h06a4308_1[md5=48b92f96da51225fe57f3fe687eec943] - defaults/linux-64::conda-content-trust==0.2.0=py313h06a4308_1[md5=aefc551e21e13ecc1de44ee589aea77d] - defaults/linux-64::conda-package-handling==2.4.0=py313h06a4308_0[md5=76b17c263bc01eaffebcb8ba7ccd6ca9] - defaults/linux-64::conda-package-streaming==0.12.0=py313h06a4308_0[md5=adef8a1cc0462068a51c68144f05be3c] - defaults/linux-64::conda==25.7.0=py313h06a4308_0[md5=2137e3bdfcba2a2bef4531b76d2f07ea] - defaults/linux-64::cpp-expected==1.1.0=hdb19cb5_0[md5=3a195bcf47b691adb4a635a8b7f396f7] - defaults/linux-64::cryptography==45.0.5=py313hea9ce0a_0[md5=e70a5914e157eb138c4620aab7bc17d9] - defaults/linux-64::dbus==1.16.2=h5bd4931_0[md5=4c4aef417b613e7111d90cf2348b231a] - defaults/linux-64::distro==1.9.0=py313h06a4308_0[md5=1fd7ab065e9958e7bbd4d3fbf175742b] - defaults/linux-64::expat==2.7.1=h6a678d5_0[md5=269942a9f3f943e2e5d8a2516a861f7c] - defaults/linux-64::fmt==9.1.0=hdb19cb5_1[md5=4f12930203ff2d84df5d287af9b29858] - defaults/linux-64::frozendict==2.4.2=py313h06a4308_0[md5=31f7036f9bdd3592e660ecfc631f054f] - defaults/linux-64::icu==73.1=h6a678d5_0[md5=6d09df641fc23f7d277a04dc7ea32dd4] - defaults/linux-64::idna==3.7=py313h06a4308_0[md5=f3e7d3ba37b45ef8782dd643d7e9733b] - defaults/linux-64::jaraco.classes==3.4.0=py313h06a4308_0[md5=c4ea3f7208a811b569bbeae8c42c5b2d] - defaults/linux-64::jaraco.context==6.0.0=py313h06a4308_0[md5=568af8d43ff7c6e7ecdc725bdc860053] - defaults/linux-64::jaraco.functools==4.1.0=py313h06a4308_0[md5=472d048415f35e29b8b39a6cfc947ccd] - defaults/linux-64::jsonpatch==1.33=py313h06a4308_1[md5=8cb4b1755a4a8fd6a57883863236ef2b] - defaults/linux-64::jsonpointer==3.0.0=py313h06a4308_0[md5=af07fefbc353b9e3292ad9e0d563d9be] - defaults/linux-64::keyring==25.6.0=py313h06a4308_0[md5=611301eaa58f7a2c9eb37376dbd84fea] - defaults/linux-64::ld_impl_linux-64==2.40=h12ee557_0[md5=ee672b5f635340734f58d618b7bca024] - defaults/linux-64::libarchive==3.7.7=hfab0078_0[md5=c208e4f83c30250d659102b271e8d4e6] - defaults/linux-64::libcurl==8.14.1=hc1efc7f_1[md5=e2d948b1b2c79337d29d294bb3698e16] - defaults/linux-64::libev==4.33=h7f8727e_1[md5=5065620db4393fb549f30114a33897d1] - defaults/linux-64::libffi==3.4.4=h6a678d5_1[md5=70646cc713f0c43926cfdcfe9b695fe0] - defaults/linux-64::libgcc-ng==11.2.0=h1234567_1[md5=a87728dabf3151fb9cfa990bd2eb0464] - defaults/linux-64::libgomp==11.2.0=h1234567_1[md5=b372c0eea9b60732fdae4b817a63c8cd] - defaults/linux-64::libmamba==2.0.5=haf1ee3a_1[md5=0f1450592dc7555e315f5d684ce481eb] - defaults/linux-64::libmambapy==2.0.5=py313hdb19cb5_1[md5=c56ed0c34af1a360984e20bf13200007] - defaults/linux-64::libmpdec==4.0.0=h5eee18b_0[md5=feb10f42b1a7b523acbf85461be41a3e] - defaults/linux-64::libnghttp2==1.57.0=h2d74bed_0[md5=674871621300f54e7ffcf93e6e341638] - defaults/linux-64::libsolv==0.7.30=he621ea3_1[md5=6918c29c4b65f21c71aac679b49c02e4] - defaults/linux-64::libssh2==1.11.1=h251f7ec_0[md5=dd68c24355431c0543339dda1404129d] - defaults/linux-64::libstdcxx-ng==11.2.0=h1234567_1[md5=57623d10a70e09e1d048c2b2b6f4e2dd] - defaults/linux-64::libuuid==1.41.5=h5eee18b_0[md5=4a6a2354414c9080327274aa514e5299] - defaults/linux-64::libxcb==1.17.0=h9b100fa_0[md5=fdf0d380fa3809a301e2dbc0d5183883] - defaults/linux-64::libxml2==2.13.8=hfdd30dd_0[md5=6da89b526f12f128af101c3f70d12c6d] - defaults/linux-64::lz4-c==1.9.4=h6a678d5_1[md5=2ee58861f2b92b868ce761abb831819d] - defaults/linux-64::markdown-it-py==2.2.0=py313h06a4308_1[md5=0c3ee40437213e528c99bff0bcc5a942] - defaults/linux-64::mdurl==0.1.0=py313h06a4308_0[md5=5bca585008b9e6ce6997871309117479] - defaults/linux-64::menuinst==2.3.1=py313h06a4308_0[md5=215cd4c223b3ab647d025f347d35c058] - defaults/linux-64::more-itertools==10.3.0=py313h06a4308_0[md5=ee08e17a18339269f11ba3109f4fb225] - defaults/linux-64::ncurses==6.5=h7934f7d_0[md5=0abfc090299da4bb031b84c64309757b] - defaults/linux-64::nlohmann_json==3.11.2=h6a678d5_0[md5=36890f7abd98066b607211b1773e6343] - defaults/linux-64::openssl==3.0.17=h5eee18b_0[md5=c032152f4080dd61875d5047641c8bf2] - defaults/linux-64::packaging==25.0=py313h06a4308_0[md5=7396e4349c90a320cb4aa1edf684886d] - defaults/linux-64::pcre2==10.42=hebb0a14_1[md5=727e15c3cfa02b032da4eb0c1123e977] - defaults/linux-64::pkce==1.0.3=py313h06a4308_0[md5=a1e79da30a6c62c6398e9bb990ee9ed6] - defaults/linux-64::platformdirs==4.3.7=py313h06a4308_0[md5=6cdbb54f78166c07399004f961726487] - defaults/linux-64::pluggy==1.5.0=py313h06a4308_0[md5=ea142d52281afe8e9a79e4a33c023e41] - defaults/linux-64::pthread-stubs==0.3=h0ce48e5_1[md5=973a642312d2a28927aaf5b477c67250] - defaults/linux-64::pycosat==0.6.6=py313h5eee18b_2[md5=60ea7416e08d78563e31d16c333bd57f] - defaults/linux-64::pydantic-core==2.33.2=py313hc6f7160_0[md5=5d5a3d0469b467688a13f505e77639ef] - defaults/linux-64::pydantic-settings==2.6.1=py313h06a4308_0[md5=37546fa6cc30a5a794b9dd505368eb84] - defaults/linux-64::pydantic==2.11.7=py313h06a4308_0[md5=7c8e28d9eb0dbf8b3bea0aa9f28f8c17] - defaults/linux-64::pygments==2.19.1=py313h06a4308_0[md5=8fcbba71964f3d4d936e846c3bc9fb13] - defaults/linux-64::pyjwt==2.10.1=py313h06a4308_0[md5=2c17b6fb0a6100caada2e7ee72308bec] - defaults/linux-64::pysocks==1.7.1=py313h06a4308_0[md5=a493580ce366b942a8e1c00ee00c4182] - defaults/linux-64::python-dotenv==1.1.0=py313h06a4308_0[md5=33e2c8b6a83ba5bdbda0639bfb37496c] - defaults/linux-64::python==3.13.5=h4612cfd_100_cp313[md5=1adf42b71c42a4a540eae2c0026f02c3] - defaults/linux-64::python_abi==3.13=0_cp313[md5=d4009c49dd2b54ffded7f1365b5f6505] - defaults/linux-64::readchar==4.0.5=py313h06a4308_0[md5=42a02a52ac3364e165087e5c753b40ce] - defaults/linux-64::readline==8.3=hc2a1206_0[md5=8578e006d4ef5cb98a6cda232b3490f6] - defaults/linux-64::reproc-cpp==14.2.4=h6a678d5_2[md5=b03aa4903158279f003e7032ab9f5601] - defaults/linux-64::reproc==14.2.4=h6a678d5_2[md5=3c6dbc6c60b3897222d79359343e90fa] - defaults/linux-64::requests==2.32.4=py313h06a4308_0[md5=c1790ae25dc021a7c6073ace845d8f55] - defaults/linux-64::rich==13.9.4=py313h06a4308_0[md5=29573c0e57aea86c5d68759975638187] - defaults/linux-64::ruamel.yaml.clib==0.2.12=py313h5eee18b_0[md5=d9da5a7327cd6c9ee11d7b7ac1b7d082] - defaults/linux-64::ruamel.yaml==0.18.10=py313h5eee18b_0[md5=70c6985c0871d511a94afb1e8537943f] - defaults/linux-64::secretstorage==3.3.1=py313h06a4308_1[md5=bd9d99500717e83799f51f36825e6c2a] - defaults/linux-64::semver==3.0.2=py313h06a4308_1[md5=42fd2505022b95daa0061e091c9ddcda] - defaults/linux-64::setuptools==78.1.1=py313h06a4308_0[md5=8f8e1c1e3af9d2d371aaa0ee8316ae7c] - defaults/linux-64::shellingham==1.5.0=py313h06a4308_0[md5=fec77e08b241c9bae71940db00e14b65] - defaults/linux-64::simdjson==3.10.1=hdb19cb5_0[md5=7b2a4b5be590071e1b4dce77b413d26a] - defaults/linux-64::spdlog==1.11.0=hdb19cb5_0[md5=023cfe6341f1d90dee2016e608538537] - defaults/linux-64::sqlite==3.50.2=hb25bd0a_1[md5=6ac08aa6b5f14911039aa04b2b2c3350] - defaults/linux-64::tk==8.6.15=h54e0aa7_0[md5=1fa91e0c4fc9c9435eda3f1a25a676fd] - defaults/linux-64::tomli==2.2.1=py313h06a4308_0[md5=4ae62c3391e11617a9f6d9556d8062c7] - defaults/linux-64::tqdm==4.67.1=py313h7040dfc_0[md5=2efb4b3310f058cb95d326989bddc761] - defaults/linux-64::truststore==0.10.1=py313h06a4308_0[md5=fee67c1946f31ba7b45962c20b7b1d8c] - defaults/linux-64::typer==0.9.0=py313h06a4308_0[md5=7c1a4cd7cd5bc54f1460e0e2a8c5c0a3] - defaults/linux-64::typing-extensions==4.12.2=py313h06a4308_0[md5=f011fee76cd912d47567c6cedb0074c9] - defaults/linux-64::typing-inspection==0.4.0=py313h06a4308_0[md5=b9349b70ca836c55debbaa5b544b0c3c] - defaults/linux-64::typing_extensions==4.12.2=py313h06a4308_0[md5=e1a419944c11dc4592cdce114d0a3063] - defaults/linux-64::urllib3==2.5.0=py313h06a4308_0[md5=8739060177d7ed31cd7292efc5bcc91e] - defaults/linux-64::wheel==0.45.1=py313h06a4308_0[md5=29057e876eedce0e37c2388c138a19f9] - defaults/linux-64::xorg-libx11==1.8.12=h9b100fa_1[md5=6298b27afae6f49f03765b2a03df2fcb] - defaults/linux-64::xorg-libxau==1.0.12=h9b100fa_0[md5=a8005a9f6eb903e113cd5363e8a11459] - defaults/linux-64::xorg-libxdmcp==1.1.5=h9b100fa_0[md5=c284a09ddfba81d9c4e740110f09ea06] - defaults/linux-64::xorg-xorgproto==2024.1=h5eee18b_1[md5=412a0d97a7a51d23326e57226189da92] - defaults/linux-64::xz==5.6.4=h5eee18b_1[md5=3581505fa450962d631bd82b8616350e] - defaults/linux-64::yaml-cpp==0.8.0=h6a678d5_1[md5=015d2d74ad3c8e53eec3358637433718] - defaults/linux-64::zlib==1.2.13=h5eee18b_1[md5=92e42d8310108b0a440fb2e60b2b2a25] - defaults/linux-64::zstandard==0.23.0=py313h2c38b39_1[md5=5b4bd26f9d674331122482d3c2ac0afe] - defaults/linux-64::zstd==1.5.6=hc292b87_0[md5=78ae7abd3020b41f827b35085845e1b8] - defaults/noarch::archspec==0.2.3=pyhd3eb1b0_0[md5=13d01ee2d343d8539bb47055a6c0b5b2] - defaults/noarch::charset-normalizer==3.3.2=pyhd3eb1b0_0[md5=c6fea3691e85cf7f568b0618ec29fc4f] - defaults/noarch::conda-anaconda-telemetry==0.3.0=pyhd3eb1b0_1[md5=2ac481091c9cc4eec50cf2f0cc42744d] - defaults/noarch::conda-libmamba-solver==25.4.0=pyhd3eb1b0_0[md5=77ff27567894c7ea3eb908489e5d3e5c] - defaults/noarch::jeepney==0.7.1=pyhd3eb1b0_0[md5=f115ef0af90b59f35ef56743955979a4] - defaults/noarch::pip==25.1=pyhc872135_2[md5=2778327d2a700153fefe0e69438b18e1] - defaults/noarch::pybind11-abi==5=hd3eb1b0_0[md5=7f0df6639fdf60ccd3045ee6faedd32f] - defaults/noarch::pycparser==2.21=pyhd3eb1b0_0[md5=135a72ff2a31150a3a3ff0b1edd41ca9] - defaults/noarch::tzdata==2025b=h04d1e81_0[md5=1d027393db3427ab22a02aa44a56f143] The following NEW packages will be INSTALLED: _libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main _openmp_mutex pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu anaconda-anon-usa~ pkgs/main/linux-64::anaconda-anon-usage-0.7.2-py313hfc0e8ea_100 anaconda-auth pkgs/main/linux-64::anaconda-auth-0.8.6-py313h06a4308_0 anaconda-cli-base pkgs/main/linux-64::anaconda-cli-base-0.5.2-py313h06a4308_0 annotated-types pkgs/main/linux-64::annotated-types-0.6.0-py313h06a4308_0 archspec pkgs/main/noarch::archspec-0.2.3-pyhd3eb1b0_0 boltons pkgs/main/linux-64::boltons-25.0.0-py313h06a4308_0 brotlicffi pkgs/main/linux-64::brotlicffi-1.0.9.2-py313h6a678d5_1 bzip2 pkgs/main/linux-64::bzip2-1.0.8-h5eee18b_6 c-ares pkgs/main/linux-64::c-ares-1.34.5-hef5626c_0 ca-certificates pkgs/main/linux-64::ca-certificates-2025.7.15-h06a4308_0 certifi pkgs/main/linux-64::certifi-2025.8.3-py313h06a4308_0 cffi pkgs/main/linux-64::cffi-1.17.1-py313h1fdaa30_1 charset-normalizer pkgs/main/noarch::charset-normalizer-3.3.2-pyhd3eb1b0_0 click pkgs/main/linux-64::click-8.2.1-py313h06a4308_0 colorama pkgs/main/linux-64::colorama-0.4.6-py313h06a4308_0 conda pkgs/main/linux-64::conda-25.7.0-py313h06a4308_0 conda-anaconda-te~ pkgs/main/noarch::conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1 conda-anaconda-tos pkgs/main/linux-64::conda-anaconda-tos-0.2.2-py313h06a4308_1 conda-content-tru~ pkgs/main/linux-64::conda-content-trust-0.2.0-py313h06a4308_1 conda-libmamba-so~ pkgs/main/noarch::conda-libmamba-solver-25.4.0-pyhd3eb1b0_0 conda-package-han~ pkgs/main/linux-64::conda-package-handling-2.4.0-py313h06a4308_0 conda-package-str~ pkgs/main/linux-64::conda-package-streaming-0.12.0-py313h06a4308_0 cpp-expected pkgs/main/linux-64::cpp-expected-1.1.0-hdb19cb5_0 cryptography pkgs/main/linux-64::cryptography-45.0.5-py313hea9ce0a_0 dbus pkgs/main/linux-64::dbus-1.16.2-h5bd4931_0 distro pkgs/main/linux-64::distro-1.9.0-py313h06a4308_0 expat pkgs/main/linux-64::expat-2.7.1-h6a678d5_0 fmt pkgs/main/linux-64::fmt-9.1.0-hdb19cb5_1 frozendict pkgs/main/linux-64::frozendict-2.4.2-py313h06a4308_0 icu pkgs/main/linux-64::icu-73.1-h6a678d5_0 idna pkgs/main/linux-64::idna-3.7-py313h06a4308_0 jaraco.classes pkgs/main/linux-64::jaraco.classes-3.4.0-py313h06a4308_0 jaraco.context pkgs/main/linux-64::jaraco.context-6.0.0-py313h06a4308_0 jaraco.functools pkgs/main/linux-64::jaraco.functools-4.1.0-py313h06a4308_0 jeepney pkgs/main/noarch::jeepney-0.7.1-pyhd3eb1b0_0 jsonpatch pkgs/main/linux-64::jsonpatch-1.33-py313h06a4308_1 jsonpointer pkgs/main/linux-64::jsonpointer-3.0.0-py313h06a4308_0 keyring pkgs/main/linux-64::keyring-25.6.0-py313h06a4308_0 ld_impl_linux-64 pkgs/main/linux-64::ld_impl_linux-64-2.40-h12ee557_0 libarchive pkgs/main/linux-64::libarchive-3.7.7-hfab0078_0 libcurl pkgs/main/linux-64::libcurl-8.14.1-hc1efc7f_1 libev pkgs/main/linux-64::libev-4.33-h7f8727e_1 libffi pkgs/main/linux-64::libffi-3.4.4-h6a678d5_1 libgcc-ng pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 libgomp pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 libmamba pkgs/main/linux-64::libmamba-2.0.5-haf1ee3a_1 libmambapy pkgs/main/linux-64::libmambapy-2.0.5-py313hdb19cb5_1 libmpdec pkgs/main/linux-64::libmpdec-4.0.0-h5eee18b_0 libnghttp2 pkgs/main/linux-64::libnghttp2-1.57.0-h2d74bed_0 libsolv pkgs/main/linux-64::libsolv-0.7.30-he621ea3_1 libssh2 pkgs/main/linux-64::libssh2-1.11.1-h251f7ec_0 libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 libuuid pkgs/main/linux-64::libuuid-1.41.5-h5eee18b_0 libxcb pkgs/main/linux-64::libxcb-1.17.0-h9b100fa_0 libxml2 pkgs/main/linux-64::libxml2-2.13.8-hfdd30dd_0 lz4-c pkgs/main/linux-64::lz4-c-1.9.4-h6a678d5_1 markdown-it-py pkgs/main/linux-64::markdown-it-py-2.2.0-py313h06a4308_1 mdurl pkgs/main/linux-64::mdurl-0.1.0-py313h06a4308_0 menuinst pkgs/main/linux-64::menuinst-2.3.1-py313h06a4308_0 more-itertools pkgs/main/linux-64::more-itertools-10.3.0-py313h06a4308_0 ncurses pkgs/main/linux-64::ncurses-6.5-h7934f7d_0 nlohmann_json pkgs/main/linux-64::nlohmann_json-3.11.2-h6a678d5_0 openssl pkgs/main/linux-64::openssl-3.0.17-h5eee18b_0 packaging pkgs/main/linux-64::packaging-25.0-py313h06a4308_0 pcre2 pkgs/main/linux-64::pcre2-10.42-hebb0a14_1 pip pkgs/main/noarch::pip-25.1-pyhc872135_2 pkce pkgs/main/linux-64::pkce-1.0.3-py313h06a4308_0 platformdirs pkgs/main/linux-64::platformdirs-4.3.7-py313h06a4308_0 pluggy pkgs/main/linux-64::pluggy-1.5.0-py313h06a4308_0 pthread-stubs pkgs/main/linux-64::pthread-stubs-0.3-h0ce48e5_1 pybind11-abi pkgs/main/noarch::pybind11-abi-5-hd3eb1b0_0 pycosat pkgs/main/linux-64::pycosat-0.6.6-py313h5eee18b_2 pycparser pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0 pydantic pkgs/main/linux-64::pydantic-2.11.7-py313h06a4308_0 pydantic-core pkgs/main/linux-64::pydantic-core-2.33.2-py313hc6f7160_0 pydantic-settings pkgs/main/linux-64::pydantic-settings-2.6.1-py313h06a4308_0 pygments pkgs/main/linux-64::pygments-2.19.1-py313h06a4308_0 pyjwt pkgs/main/linux-64::pyjwt-2.10.1-py313h06a4308_0 pysocks pkgs/main/linux-64::pysocks-1.7.1-py313h06a4308_0 python pkgs/main/linux-64::python-3.13.5-h4612cfd_100_cp313 python-dotenv pkgs/main/linux-64::python-dotenv-1.1.0-py313h06a4308_0 python_abi pkgs/main/linux-64::python_abi-3.13-0_cp313 readchar pkgs/main/linux-64::readchar-4.0.5-py313h06a4308_0 readline pkgs/main/linux-64::readline-8.3-hc2a1206_0 reproc pkgs/main/linux-64::reproc-14.2.4-h6a678d5_2 reproc-cpp pkgs/main/linux-64::reproc-cpp-14.2.4-h6a678d5_2 requests pkgs/main/linux-64::requests-2.32.4-py313h06a4308_0 rich pkgs/main/linux-64::rich-13.9.4-py313h06a4308_0 ruamel.yaml pkgs/main/linux-64::ruamel.yaml-0.18.10-py313h5eee18b_0 ruamel.yaml.clib pkgs/main/linux-64::ruamel.yaml.clib-0.2.12-py313h5eee18b_0 secretstorage pkgs/main/linux-64::secretstorage-3.3.1-py313h06a4308_1 semver pkgs/main/linux-64::semver-3.0.2-py313h06a4308_1 setuptools pkgs/main/linux-64::setuptools-78.1.1-py313h06a4308_0 shellingham pkgs/main/linux-64::shellingham-1.5.0-py313h06a4308_0 simdjson pkgs/main/linux-64::simdjson-3.10.1-hdb19cb5_0 spdlog pkgs/main/linux-64::spdlog-1.11.0-hdb19cb5_0 sqlite pkgs/main/linux-64::sqlite-3.50.2-hb25bd0a_1 tk pkgs/main/linux-64::tk-8.6.15-h54e0aa7_0 tomli pkgs/main/linux-64::tomli-2.2.1-py313h06a4308_0 tqdm pkgs/main/linux-64::tqdm-4.67.1-py313h7040dfc_0 truststore pkgs/main/linux-64::truststore-0.10.1-py313h06a4308_0 typer pkgs/main/linux-64::typer-0.9.0-py313h06a4308_0 typing-extensions pkgs/main/linux-64::typing-extensions-4.12.2-py313h06a4308_0 typing-inspection pkgs/main/linux-64::typing-inspection-0.4.0-py313h06a4308_0 typing_extensions pkgs/main/linux-64::typing_extensions-4.12.2-py313h06a4308_0 tzdata pkgs/main/noarch::tzdata-2025b-h04d1e81_0 urllib3 pkgs/main/linux-64::urllib3-2.5.0-py313h06a4308_0 wheel pkgs/main/linux-64::wheel-0.45.1-py313h06a4308_0 xorg-libx11 pkgs/main/linux-64::xorg-libx11-1.8.12-h9b100fa_1 xorg-libxau pkgs/main/linux-64::xorg-libxau-1.0.12-h9b100fa_0 xorg-libxdmcp pkgs/main/linux-64::xorg-libxdmcp-1.1.5-h9b100fa_0 xorg-xorgproto pkgs/main/linux-64::xorg-xorgproto-2024.1-h5eee18b_1 xz pkgs/main/linux-64::xz-5.6.4-h5eee18b_1 yaml-cpp pkgs/main/linux-64::yaml-cpp-0.8.0-h6a678d5_1 zlib pkgs/main/linux-64::zlib-1.2.13-h5eee18b_1 zstandard pkgs/main/linux-64::zstandard-0.23.0-py313h2c38b39_1 zstd pkgs/main/linux-64::zstd-1.5.6-hc292b87_0 Downloading and Extracting Packages: Preparing transaction: done Executing transaction: done installation finished. Do you wish to update your shell profile to automatically initialize conda? This will activate conda on startup and change the command prompt when activated. If you'd prefer that conda's base environment not be activated on startup, run the following command when conda is activated: conda config --set auto_activate_base false You can undo this by running `conda init --reverse $SHELL`? [yes|no] [no] >>> yse You have chosen to not have conda modify your shell scripts at all. To activate conda's base environment in your current shell session: eval "$(/home/haoge/miniconda3/bin/conda shell.YOUR_SHELL_NAME hook)" To install conda's shell functions for easier access, first activate, then: conda init Thank you for installing Miniconda3! haoge@DESKTOP-3UM43SH:~$ conda create -n wrf python=3.8 conda activate wrf conda: command not found conda: command not found haoge@DESKTOP-3UM43SH:~$
最新发布
09-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值