代码之家  ›  专栏  ›  技术社区  ›  AmirMohammad Shakeri

无法在python 3.12中安装matplotlib

  •  1
  • AmirMohammad Shakeri  · 技术社区  · 2 年前

    当我尝试安装 matplotlib 3.8.0 在我的conda环境中 miniconda包管理器 我得到以下错误:

    Solving environment: / warning  libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
    failed
    
    LibMambaUnsatisfiableError: Encountered problems while solving:
      - cannot install both pin-1-1 and pin-1-1
      - nothing provides numpy 1.10* needed by matplotlib-1.5.3-np110py34_1
    
    Could not solve for environment specs
    The following packages are incompatible
    ├─ matplotlib is installable with the potential options
    │  ├─ matplotlib 1.5.3 would require
    │  │  └─ numpy 1.10* , which does not exist (perhaps a missing channel);
    │  ├─ matplotlib 1.5.3 would require
    │  │  └─ python 3.4*  but there are no viable options
    │  │     ├─ python 3.4.5 would require
    │  │     │  └─ vc 10.* , which does not exist (perhaps a missing channel);
    │  │     └─ python 3.4.5 would require
    │  │        └─ vs2010_runtime, which does not exist (perhaps a missing channel);
    │  ├─ matplotlib 1.5.3 would require
    │  │  └─ pyqt 4.11.* , which requires
    │  │     └─ qt 4.8.* , which does not exist (perhaps a missing channel);
    │  ├─ matplotlib [2.0.2|2.1.0|...|2.2.4] would require
    │  │  └─ python >=2.7,<2.8.0a0 , which can be installed;
    │  ├─ matplotlib [2.0.2|2.1.0|...|3.3.4] would require
    │  │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │  ├─ matplotlib [2.1.2|2.2.2|...|3.5.3] would require
    │  │  └─ python >=3.7,<3.8.0a0 , which can be installed;
    │  ├─ matplotlib [2.2.4|3.1.1|...|3.7.3] would require
    │  │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │  ├─ matplotlib 2.2.5 would require
    │  │  └─ matplotlib-base >=2.2.5,<2.2.6.0a0  with the potential options
    │  │     ├─ matplotlib-base 2.2.5 would require
    │  │     │  └─ python >=2.7,<2.8.0a0 , which can be installed;
    │  │     ├─ matplotlib-base [2.2.5|3.2.0|...|3.3.2] would require
    │  │     │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │  │     ├─ matplotlib-base [2.2.5|3.2.0|...|3.3.2] would require
    │  │     │  └─ python >=3.7,<3.8.0a0 , which can be installed;
    │  │     ├─ matplotlib-base [2.2.5|3.2.0|...|3.3.2] would require
    │  │     │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │  │     └─ matplotlib-base [2.2.5|3.3.2] would require
    │  │        └─ python >=3.9,<3.10.0a0 , which can be installed;
    │  ├─ matplotlib [3.2.0|3.2.1|3.2.2|3.3.0|3.3.1] would require
    │  │  └─ matplotlib-base [>=3.2.0,<3.2.1.0a0 |>=3.2.1,<3.2.2.0a0 |>=3.2.2,<3.2.3.0a0 |>=3.3.0,<3.3.1.0a0 |>=3.3.1,<3.3.2.0a0 ], whic;
    │  ├─ matplotlib 3.3.2 would require
    │  │  └─ matplotlib-base >=3.3.2,<3.3.3.0a0 , which can be installed (as previously explained);
    │  ├─ matplotlib [3.3.2|3.3.3|...|3.8.0] would require
    │  │  └─ python >=3.9,<3.10.0a0 , which can be installed;
    │  ├─ matplotlib [3.4.3|3.5.0|...|3.8.0] would require
    │  │  └─ python >=3.10,<3.11.0a0 , which can be installed;
    │  ├─ matplotlib [3.6.1|3.6.2|...|3.8.0] would require
    │  │  └─ python >=3.11,<3.12.0a0 , which can be installed;
    │  └─ matplotlib [2.0.2|2.1.0|...|3.0.0] would require
    │     └─ python >=3.5,<3.6.0a0 , which can be installed;
    └─ pin-1 is not installable because there are no viable options
       ├─ pin-1 1 would require
       │  └─ python 3.12.* , which conflicts with any installable versions previously reported;
       └─ pin-1 1 would require
          └─ python 3.12.* , which conflicts with any installable versions previously reported.
    
    Pins seem to be involved in the conflict. Currently pinned specs:
     - python 3.12.* (labeled as 'pin-1')
    
    
    
    (datasc) C:\Users\USER>conda install matplotlib -c conda-forge
    Channels:
     - conda-forge
     - defaults
    Platform: win-64
    Collecting package metadata (repodata.json): done
    Solving environment: \ warning  libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
    failed
    
    LibMambaUnsatisfiableError: Encountered problems while solving:
      - cannot install both pin-1-1 and pin-1-1
      - nothing provides numpy 1.10* needed by matplotlib-1.5.3-np110py34_1
    
    Could not solve for environment specs
    The following packages are incompatible
    ├─ matplotlib is installable with the potential options
    │  ├─ matplotlib 1.5.3 would require
    │  │  └─ numpy 1.10* , which does not exist (perhaps a missing channel);
    │  ├─ matplotlib 1.5.3 would require
    │  │  └─ python 3.4*  but there are no viable options
    │  │     ├─ python 3.4.5 would require
    │  │     │  └─ vc 10.* , which does not exist (perhaps a missing channel);
    │  │     └─ python 3.4.5 would require
    │  │        └─ vs2010_runtime, which does not exist (perhaps a missing channel);
    │  ├─ matplotlib 1.5.3 would require
    │  │  └─ pyqt 4.11.* , which requires
    │  │     └─ qt 4.8.* , which does not exist (perhaps a missing channel);
    │  ├─ matplotlib [2.0.2|2.1.0|...|2.2.4] would require
    │  │  └─ python >=2.7,<2.8.0a0 , which can be installed;
    │  ├─ matplotlib [2.0.2|2.1.0|...|3.3.4] would require
    │  │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │  ├─ matplotlib [2.1.2|2.2.2|...|3.5.3] would require
    │  │  └─ python >=3.7,<3.8.0a0 , which can be installed;
    │  ├─ matplotlib [2.2.4|3.1.1|...|3.7.3] would require
    │  │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │  ├─ matplotlib 2.2.5 would require
    │  │  └─ matplotlib-base >=2.2.5,<2.2.6.0a0  with the potential options
    │  │     ├─ matplotlib-base 2.2.5 would require
    │  │     │  └─ python >=2.7,<2.8.0a0 , which can be installed;
    │  │     ├─ matplotlib-base [2.2.5|3.2.0|...|3.3.2] would require
    │  │     │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │  │     ├─ matplotlib-base [2.2.5|3.2.0|...|3.3.2] would require
    │  │     │  └─ python >=3.7,<3.8.0a0 , which can be installed;
    │  │     ├─ matplotlib-base [2.2.5|3.2.0|...|3.3.2] would require
    │  │     │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │  │     └─ matplotlib-base [2.2.5|3.3.2] would require
    │  │        └─ python >=3.9,<3.10.0a0 , which can be installed;
    │  ├─ matplotlib [3.2.0|3.2.1|3.2.2|3.3.0|3.3.1] would require
    │  │  └─ matplotlib-base [>=3.2.0,<3.2.1.0a0 |>=3.2.1,<3.2.2.0a0 |>=3.2.2,<3.2.3.0a0 |>=3.3.0,<3.3.1.0a0 |>=3.3.1,<3.3.2.0a0 ], whic;
    │  ├─ matplotlib 3.3.2 would require
    │  │  └─ matplotlib-base >=3.3.2,<3.3.3.0a0 , which can be installed (as previously explained);
    │  ├─ matplotlib [3.3.2|3.3.3|...|3.8.0] would require
    │  │  └─ python >=3.9,<3.10.0a0 , which can be installed;
    │  ├─ matplotlib [3.4.3|3.5.0|...|3.8.0] would require
    │  │  └─ python >=3.10,<3.11.0a0 , which can be installed;
    │  ├─ matplotlib [3.6.1|3.6.2|...|3.8.0] would require
    │  │  └─ python >=3.11,<3.12.0a0 , which can be installed;
    │  └─ matplotlib [2.0.2|2.1.0|...|3.0.0] would require
    │     └─ python >=3.5,<3.6.0a0 , which can be installed;
    └─ pin-1 is not installable because there are no viable options
       ├─ pin-1 1 would require
       │  └─ python 3.12.* , which conflicts with any installable versions previously reported;
       └─ pin-1 1 would require
          └─ python 3.12.* , which conflicts with any installable versions previously reported.
    
    Pins seem to be involved in the conflict. Currently pinned specs:
     - python 3.12.* (labeled as 'pin-1')
    

    我已将解算器设置为 libmamba 所以这就是为什么信息看起来有点不同。

    除了将我的python降级为 3.9 ?我宁愿用最新的版本 3.12.0

    2 回复  |  直到 2 年前
        1
  •  5
  •   maddes8cht    2 年前

    截至撰写问题时,python 3.12才刚刚发布几天。 天数 ! 你不必 降级 你的python到3.9。

    • 它是 conda 。您只需使用另一个python 3.9环境,然后安装所需的任何内容。就是这样 Conda 是为。
    • Matplotlib已经可以很好地与 Python 3.11 .无需降低到3.9
    • 真的,只是几个 老的给它一些时间。保留您的python 3.11环境,并将其用于您想要使用matplotlib的任何用途。为Python 3.12的第一步保留一个Python 3.12环境,并尝试不时安装matplotlib。在某个时刻, matplotlib 将在那里。再等几天。
        2
  •  0
  •   Trenton McKinney ivirshup    2 年前

    创造 conda 环境

    conda create -n py312 python=3.12 matplotlib=3.8.0 seaborn=0.13 pandas=2.1.1
    

    enter image description here

    JupyterLab选定的内核

    enter image description here

    .ccondarc 文件

    • 中的以下通道 .ccondarc 无需使用指定通道 -c
    channels:
      - defaults
      - conda-forge
    report_errors: true