使用Conda 3.6安装imutils包遇错,咨询版本依赖问题
Hey there, let's break down what's going on here and get you sorted:
First off, imutils itself doesn't have a strict dependency on a specific Conda version. The problem you're facing is tied to the Conda channel you're using (mlgill) not providing a build of imutils that's compatible with Python 3.6. Meanwhile, pip works because the PyPI version of imutils still supports older Python versions like 3.6 (even though Python 3.6 is no longer officially supported).
Here are your solutions, ordered by simplicity:
1. Try installing from the conda-forge channel
The conda-forge channel tends to have broader version coverage for popular packages compared to smaller channels like mlgill. Give this command a shot:
conda install -c conda-forge imutils
If conda-forge also doesn't have a Python 3.6-compatible build, move on to the next option.
2. Use pip within your Conda environment
Since you already know pip works, you can safely install imutils directly in your Conda Python 3.6 environment without breaking anything:
- First activate your target Conda environment:
conda activate your_environment_name
- Then run the pip install command:
pip install imutils
This will install imutils into your Conda environment's site-packages directory, just like any Conda-installed package would.
Quick note on the difference between Conda and pip here
- The PyPI version of imutils is maintained directly by the package author, and its setup configuration allows compatibility with older Python versions (like 3.6).
- Conda channels (especially smaller ones) rely on community contributors to build and update packages. Once a Python version reaches end-of-life (like 3.6 did in 2021), many channels stop building new packages for it, which is why you're seeing the error with
conda install.
内容的提问来源于stack exchange,提问作者Niranjan Ravi

