ImportError: cannot import name ‘_c_internal_utils‘ from partially initialized module ‘matplotlib‘

 原有环境已经下载matplotlib,虚拟环境中无法正常安装

setting中无法成功下载

  1. win+R输入cmd
  2. ...Lib\site-packages直接安装包下载pip install -i https://pypi.doubanio.com/simple/ matplotlib
  3. 无法成功下载
  4. pip show matplotlib显示所在地址
    1. 输入cd \d 虚拟环境安装包地址跳转到目标地址\Scripts中
    2. 下载pip install -i https://pypi.doubanio.com/simple/ matplotlib
    3. 补充:
      1. 出现错误ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. scipy 1.8.1 requires numpy<1.25.0,>=1.17.3, but you have numpy 1.26.4 which is incompatible.代表numpy格式不对
      2. pip show numpy显示所在地址、格式ImportError: cannot import name ‘_c_internal_utils‘ from partially initialized module ‘matplotlib‘_第1张图片
      3. 以目标地址为target下载指定的numpyG:\tensorflow2\envs\my_tensorflow\Scripts>pip install -i https://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com --target=G:\tensorflow2\envs\my_tensorflow\Lib\site-packages numpy==1.24.3
  5. 重新下载pip install -i https://pypi.doubanio.com/simple/ matplotlib
  6. 如果仍然不行重新卸载matplotlib库,使用:pip uninstall matplotlib,相关的也建议删除,然后重新安装:pip install -i https://pypi.doubanio.com/simple/ matplotlib

2024.4.19

你可能感兴趣的:(matplotlib)