Ubuntu14.04下conda安装python3.6遇依赖冲突排查求助
Let’s walk through how to fix this dependency conflict between python=3.6 and ssl_match_hostname (which is requiring Python 2.7) step by step:
First, verify your current environment and package state
Run these commands to get a clearer picture of what’s installed:conda infoto check your active environment and conda version (old conda versions often struggle with dependency solving)conda list ssl_match_hostnameto confirm if this package is already present in your environment, and which version it is- If
conda info ssl_match_hostnamereturns nothing, tryconda search --info ssl_match_hostnameinstead—this will pull details about available versions across your configured channels, including their Python compatibility.
Update conda first (critical for old systems like Ubuntu 14.04)
Outdated conda versions are a common cause of unsolvable environment conflicts. Run this to update the base conda installation:conda update -n base condaOnce updated, retry your original command:
conda install python=3.6Try installing from the conda-forge channel
The default conda channels might have an older version ofssl_match_hostnamethat only supports Python 2.7. Conda-forge typically maintains more up-to-date packages with broader Python compatibility. Run:conda install -c conda-forge python=3.6Remove conflicting packages manually (if safe)
Ifssl_match_hostnameis installed and isn’t a critical dependency for your current environment, you can remove it first before installing Python 3.6:conda remove ssl_match_hostname conda install python=3.6After installing Python 3.6, you can reinstall a compatible version of
ssl_match_hostnamefrom conda-forge if needed:conda install -c conda-forge ssl_match_hostnameConsider creating a fresh environment instead
If modifying your existing environment is too messy, create a dedicated Python 3.6 environment:conda create -n py36_env python=3.6If you need this environment’s Python binary to live at
~/anaconda3/bin/python3.6, you can create a symlink from the environment’s Python to that path (just make sure to back up the original file first if it exists):ln -s ~/anaconda3/envs/py36_env/bin/python3.6 ~/anaconda3/bin/python3.6Check for system-level package interference
Ubuntu 14.04 has older system libraries, so ensure you haven’t mixed conda packages with system-installed Python packages. Avoid usingsudowith conda commands, as this can cause conflicts with system-level files.
内容的提问来源于stack exchange,提问作者Mittenchops

