Managing Python — Conda 4.13.0.post43+6ed9db722 Documentation

Skip to main content Back to top Ctrl+K conda 26.1.2.dev42 documentation - Home
  • GitHub
  • Zulip
  • Discourse
  • GitHub
  • Zulip
  • Discourse

Navigation

  • User guide
    • Getting started with conda
    • Installing conda
      • Installing on Windows
      • Installing on macOS
      • Installing on Linux
    • Tasks
      • Managing conda
      • Managing environments
      • Managing channels
      • Managing packages
      • Managing Python
      • Managing virtual packages
      • Creating custom channels
      • Creating projects
      • Viewing command-line help
    • Configuration
      • Using the .condarc conda configuration file
      • Settings
      • Administering a multi-user conda installation
      • Mirroring channels
      • Disabling SSL verification
      • Using non-standard certificates
      • Using Custom Locations for Environment and Package Cache
      • Configuring Temporary File Locations
      • Improving interoperability with pip
    • Concepts
      • Commands
      • Packages
      • Package specification
      • Package search and install specifications
      • Channels
      • Environments
      • Installing with conda
      • Performance
      • Conda for data scientists
      • Plugins
    • Troubleshooting
    • Cheatsheet
  • Configuration
  • Commands
    • conda activate
    • conda clean
    • conda compare
    • conda config
    • conda create
    • conda deactivate
    • conda doctor
    • conda env
      • conda env config
        • conda env config vars
          • conda env config vars list
          • conda env config vars set
          • conda env config vars unset
      • conda env create
      • conda env export
      • conda env list
      • conda env remove
      • conda env update
    • conda export
    • conda info
    • conda init
    • conda install
    • conda list
    • conda notices
    • conda package
    • conda repoquery
      • conda repoquery depends
      • conda repoquery search
      • conda repoquery whoneeds
    • conda remove
    • conda rename
    • conda run
    • conda search
    • conda update
    • conda commands
  • Release notes
  • Glossary
  • Developer guide
    • Architecture
    • Contributing to conda
    • Development Environment
    • Deep dives
      • conda install
      • conda init and conda activate
      • conda config and context
      • Programmatic .condarc File API
      • Solvers
      • Logging
    • Writing Tests
      • Integration Tests
      • HTTP Test Server Fixture
      • Testing with Windows AppLocker
    • Deprecations
    • Releasing
    • Plugins
      • Auth Handlers
      • Environment Exporters
      • Environment Specifiers
      • Health Checks
      • Package extractors
      • Post-commands
      • Pre-commands
      • Pre-transactions
      • Post-transactions
      • PrefixData loaders
      • Reporter Backends
      • Request Headers
      • Settings
      • Solvers
      • Subcommands
      • Virtual Packages
    • Specifications
      • Technical specification: solver state
  • API Guide
    • conda
      • __main__
      • _vendor
      • _version
      • activate
      • api
      • auxlib
        • collection
        • compat
        • decorators
        • entity
        • exceptions
        • ish
        • logz
        • type_coercion
      • base
        • constants
        • context
      • cli
        • actions
        • common
        • conda_argparse
        • condarc
        • find_commands
        • helpers
        • install
        • main
        • main_clean
        • main_commands
        • main_compare
        • main_config
        • main_create
        • main_env
        • main_env_config
        • main_env_create
        • main_env_list
        • main_env_remove
        • main_env_update
        • main_env_vars
        • main_export
        • main_info
        • main_init
        • main_install
        • main_list
        • main_mock_activate
        • main_mock_deactivate
        • main_notices
        • main_package
        • main_pip
        • main_remove
        • main_rename
        • main_run
        • main_search
        • main_update
      • common
        • _logic
        • _os
          • linux
          • osx
          • unix
          • windows
        • compat
        • configuration
        • constants
        • io
        • iterators
        • logic
        • path
          • _cygpath
          • directories
          • python
          • windows
        • pkg_formats
          • python
        • serialize
          • json
          • yaml
        • signals
        • toposort
        • url
      • core
        • envs_manager
        • index
        • initialize
        • link
        • package_cache_data
        • path_actions
        • portability
        • prefix_data
        • solve
        • subdir_data
      • deprecations
      • env
        • env
        • installers
          • base
          • conda
          • pip
        • pip_util
        • specs
          • binstar
          • cep_24
          • explicit
          • requirements
          • yaml_file
      • exception_handler
      • exceptions
      • exports
      • gateways
        • anaconda_client
        • connection
          • adapters
            • ftp
            • http
            • localfs
            • s3
          • download
          • session
        • disk
          • create
          • delete
          • link
          • lock
          • permissions
          • read
          • test
          • update
        • logging
        • repodata
          • jlap
            • core
            • fetch
            • interface
          • lock
        • subprocess
      • history
      • instructions
      • misc
      • models
        • channel
        • dist
        • enums
        • environment
        • match_spec
        • package_info
        • prefix_graph
        • records
        • version
      • notices
        • cache
        • core
        • fetch
        • types
        • views
      • plan
      • plugins
        • config
        • environment_exporters
          • environment_yml
          • explicit
          • requirements_txt
        • environment_specifiers
          • cep_24
          • environment_yml
          • explicit
          • requirements_txt
        • hookspec
        • manager
        • package_extractors
          • conda
        • post_solves
          • signature_verification
        • prefix_data_loaders
          • pypi
            • pkg_format
        • reporter_backends
          • console
          • json
        • solvers
        • subcommands
          • doctor
            • health_checks
              • altered_files
              • consistency
              • environment_txt
              • file_locking
              • missing_files
              • pinned
              • requests_ca_bundle
        • types
        • virtual_packages
          • archspec
          • conda
          • cuda
          • freebsd
          • linux
          • osx
          • windows
      • reporters
      • resolve
      • testing
        • cases
        • fixtures
        • gateways
          • fixtures
        • helpers
        • http_test_server
        • integration
        • notices
          • fixtures
          • helpers
        • solver_helpers
      • trust
        • constants
        • signature_verification
      • utils
    • conda_env
      • cli
      • installers
  • User guide
  • Tasks
  • Managing Python
Managing Python#

Conda treats Python the same as any other package, so it is easy to manage and update multiple installations.

Conda supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Viewing a list of available Python versions#

To list the versions of Python that are available to install, in your terminal window, run:

conda search python

This lists all packages whose names contain the text python.

To list only the packages whose full name is exactly python, add the --full-name option. In your terminal window, run:

conda search --full-name python

Installing a different version of Python#

To install a different version of Python without overwriting the current version, create a new environment and install the second Python version into it:

  1. Create the new environment:

    • To create the new environment for Python 3.9, in your terminal window run:

      condacreate-npy39python=3.9

      Note

      Replace py39 with the name of the environment you want to create. python=3.9 is the package and version you want to install in this new environment. This could be any package, such as numpy=1.19, or multiple packages.

  2. Activate the new environment.

  3. Verify that the new environment is your current environment.

  4. To verify that the current environment uses the new Python version, in your terminal window, run:

    python --version

Installing PyPy#

To use the PyPy builds you can do the following:

conda config --add channels conda-forge conda config --set channel_priority strict conda create -n pypy pypy conda activate pypy

Using a different version of Python#

To switch to an environment that has different version of Python, activate the environment.

Updating Python#

To update Python to the latest version in your environment, run:

conda update python

This command will update you to the latest major release (e.g. from python=3.10 to python=3.12).

If you would like to remain on a minor release, use the conda install command instead:

conda install python=3.10 On this page
  • Viewing a list of available Python versions
  • Installing a different version of Python
  • Installing PyPy
  • Using a different version of Python
  • Updating Python
Edit on GitHub Show Source

Từ khóa » Cài đặt Python 3.7.8