You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行conda install tensorflow时出现依赖冲突错误求助

Fixing Conda Dependency Conflict Between Numba and 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:

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_env with 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 remove numba
    conda install tensorflow
    conda install numba
    
    Conda will pick a Numba version that plays nice with the NumPy version TensorFlow installs.

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:
    pip install tensorflow
    
    Or vice versa—remove TensorFlow, install Numba, then use pip for TensorFlow.

内容的提问来源于stack exchange,提问作者Neelotpal Nauriyal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:55:03