执行conda install tensorflow时出现依赖冲突错误求助
Got it, let's work through this dependency conflict. The core issue is that your installed numba requires NumPy in the range >=1.14,<1.15.0a0, but TensorFlow depends on a NumPy version that doesn't align with this. Here are three practical solutions to resolve this:
1. Create a New Isolated Conda Environment (Recommended)
This is the safest approach because it keeps your existing environment intact and avoids messing with existing package versions.
- First, create a new environment (replace
tf_envwith any name you like, and adjust the Python version to match TensorFlow's compatibility—3.8 is a solid choice for most recent TensorFlow versions):conda create -n tf_env python=3.8 - Activate the new environment:
conda activate tf_env - Install TensorFlow first:
conda install tensorflow - If you need Numba in this environment later, install it—Conda will automatically resolve compatible versions for both packages:
conda install numba
2. Adjust Package Versions in Your Existing Environment
If you want to fix the conflict in your current environment, you can force Conda to find compatible versions of TensorFlow and Numba:
- First, check the NumPy version requirements for TensorFlow to understand what's compatible:
conda info tensorflow - Try installing a specific version of TensorFlow that works with NumPy 1.14.x (you may need to test a few versions—for example, TensorFlow 2.0 is known to work with NumPy 1.14):
conda install tensorflow=2.0 numba - Alternatively, temporarily remove Numba, install TensorFlow, then reinstall a version of Numba compatible with TensorFlow's NumPy:
Conda will pick a Numba version that plays nice with the NumPy version TensorFlow installs.conda remove numba conda install tensorflow conda install numba
3. Use Pip for One Package (Last Resort)
If the above methods don't work, you can use pip to install one of the packages, but note that this can lead to version mismatches later. Only use this if the first two options fail:
- Keep your existing Numba installation and install TensorFlow via pip:
Or vice versa—remove TensorFlow, install Numba, then use pip for TensorFlow.pip install tensorflow
内容的提问来源于stack exchange,提问作者Neelotpal Nauriyal

