我想将 Kivy 安装到我的 Anaconda 教程环境中。
根据https://kivy.org/doc/stable/gettingstarted/installation.html#install-conda 我使用了
conda install kivy -c conda-forge
命令。
但我有一个错误。
在 Kivy 库之前,我只安装了
pip install Django==5.1.3
没有问题。
之后,当我尝试安装 Kivy 时,出现以下错误。
错误:
---------- -------
pip 24.2
setuptools 75.1.0
wheel 0.44.0
(tutorialEnv) C:\Users\mecra\OneDrive\Desktop\Python>pip install Django==5.1.3
Collecting Django==5.1.3
Downloading Django-5.1.3-py3-none-any.whl.metadata (4.2 kB)
Collecting asgiref<4,>=3.8.1 (from Django==5.1.3)
Using cached asgiref-3.8.1-py3-none-any.whl.metadata (9.3 kB)
Collecting sqlparse>=0.3.1 (from Django==5.1.3)
Using cached sqlparse-0.5.1-py3-none-any.whl.metadata (3.9 kB)
Collecting tzdata (from Django==5.1.3)
Using cached tzdata-2024.2-py2.py3-none-any.whl.metadata (1.4 kB)
Downloading Django-5.1.3-py3-none-any.whl (8.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.3/8.3 MB 408.7 kB/s eta 0:00:00
Using cached asgiref-3.8.1-py3-none-any.whl (23 kB)
Using cached sqlparse-0.5.1-py3-none-any.whl (44 kB)
Using cached tzdata-2024.2-py2.py3-none-any.whl (346 kB)
Installing collected packages: tzdata, sqlparse, asgiref, Django
Successfully installed Django-5.1.3 asgiref-3.8.1 sqlparse-0.5.1 tzdata-2024.2
(tutorialEnv) C:\Users\mecra\OneDrive\Desktop\Python>pip list
Package Version
---------- -------
asgiref 3.8.1
Django 5.1.3
pip 24.2
setuptools 75.1.0
sqlparse 0.5.1
tzdata 2024.2
wheel 0.44.0
(tutorialEnv) C:\Users\mecra\OneDrive\Desktop\Python>conda install kivy -c conda-forge
Retrieving notices: ...working... done
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:
- package kivy-1.10.1-py27h7bc4a79_2 requires python >=2.7,<2.8.0a0, but none of the providers can be installed
Could not solve for environment specs
The following packages are incompatible
├─ kivy is installable with the potential options
│ ├─ kivy [1.10.1|1.11.0|1.11.1] would require
│ │ └─ python >=2.7,<2.8.0a0 , which can be installed;
│ ├─ kivy 1.10.1 would require
│ │ └─ python >=3.5,<3.6.0a0 , which can be installed;
│ ├─ kivy [1.10.1|1.11.0|1.11.1|2.0.0|2.0.0rc4] would require
│ │ └─ python >=3.6,<3.7.0a0 , which can be installed;
│ ├─ kivy [1.10.1|1.11.0|...|2.1.0] would require
│ │ └─ python >=3.7,<3.8.0a0 , which can be installed;
│ ├─ kivy [1.11.1|2.0.0|...|2.3.0] would require
│ │ └─ python >=3.8,<3.9.0a0 , which can be installed;
│ ├─ kivy [2.0.0|2.1.0|2.2.0|2.2.1|2.3.0] would require
│ │ └─ python >=3.10,<3.11.0a0 , which can be installed;
│ ├─ kivy [2.0.0|2.0.0rc4|...|2.3.0] would require
│ │ └─ python >=3.9,<3.10.0a0 , which can be installed;
│ └─ kivy [2.2.1|2.3.0] would require
│ └─ python >=3.11,<3.12.0a0 , which can be installed;
└─ pin-1 is not installable because it requires
└─ python 3.12.* , which conflicts with any installable versions previously reported.
我该如何解决这个问题?
谢谢
您需要按照
Python 3.11
的错误消息中的建议降级到 Kivy 2.3
,因为它与 Python 3.12
冲突
conda install python=3.11
然后重新安装
Kivy 2.3