Dependency handoffs break when a Conda environment takes a newer package than the project was tested against. A version-constrained install tells Conda which package release must satisfy the solve before it changes the target environment.
conda install accepts package specs such as requests=2.32.5 and applies them to either the active environment or a named environment selected with --name. Searching first confirms that the requested version exists in the configured channels before the solver starts a transaction that cannot succeed.
The install constraint affects the current transaction. Future update commands can still move the package unless the environment also has a pin, so record exact versions in the project environment file or package pin policy when reproducibility matters after installation.
$ conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main accepted Terms of Service for https://repo.anaconda.com/pkgs/main
Run this only for channels your organization allows. If Conda lists more than one blocked channel, repeat the command for each listed URL or remove the channel instead.
$ conda env list # conda environments: # # * -> active # + -> frozen base /opt/conda analytics /opt/conda/envs/analytics
Use an existing environment for the install. Create the environment first if the target name is missing.
Related: How to list Anaconda environments
Related: How to create a Conda environment
$ conda search --full-name requests Loading channels: done # Name Version Build Channel requests 2.24.0 py_0 pkgs/main requests 2.25.0 pyhd3eb1b0_0 pkgs/main ##### snipped ##### requests 2.32.4 py313hd43f75c_0 pkgs/main requests 2.32.5 py313hd43f75c_0 pkgs/main requests 2.32.5 py313hd43f75c_1 pkgs/main requests 2.33.1 py313hd43f75c_0 pkgs/main requests 2.34.2 py313hd43f75c_0 pkgs/main
Replace requests with the package name. Use the same channel settings or --channel option that the target environment should use.
Related: How to search for Conda package versions
$ conda install --name analytics "requests=2.32.5" --yes
Channels:
- defaults
Platform: linux-aarch64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /opt/conda/envs/analytics
added / updated specs:
- requests=2.32.5
The following NEW packages will be INSTALLED:
brotlicffi pkgs/main/linux-aarch64::brotlicffi-1.2.0.0-py313h5b11e9f_0
certifi pkgs/main/linux-aarch64::certifi-2026.5.20-py313hd43f75c_0
##### snipped #####
requests pkgs/main/linux-aarch64::requests-2.32.5-py313hd43f75c_1
urllib3 pkgs/main/linux-aarch64::urllib3-2.7.0-py313hd43f75c_0
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Leave off --yes when the package plan should be reviewed before the transaction runs. Use an exact version such as requests=2.32.5 when the project needs that release, or a narrow series such as requests=2.32.* only when patch-level movement is allowed.
$ conda list --name analytics requests # packages in environment at /opt/conda/envs/analytics: # # Name Version Build Channel requests 2.32.5 py313hd43f75c_1
The Version column should match the requested version. If the package name appears more than once, review channel priority and build constraints before using the environment.
Related: How to list packages in an Anaconda environment
$ conda run --name analytics python -c "import requests; print(requests.__version__)" 2.32.5
Replace the sample Python import with the command, notebook import, or executable that proves the installed package works for the project.