winforms Python v 3.11.2和Windows 11 22H2操作系统构建版本上的Kivy安装错误:22621.1265

2cmtqfgy  于 2023-02-24  发布在  Python
关注(0)|答案(2)|浏览(244)

我试着在新的Windows 11安装上安装Kivy。即使在我满足了所需的依赖关系后,我还是不断收到安装错误。以下是我收到的响应。

Updated build\lib.win-amd64-cpython-311\kivy\include\config.h
      Updated C:\Users\nadee\AppData\Local\Temp\pip-install-878mjsbv\kivy_43cb622015164809b06a8b1af4948f34\kivy\include\config.h
      Updated build\lib.win-amd64-cpython-311\kivy\include\config.pxi
      Updated C:\Users\nadee\AppData\Local\Temp\pip-install-878mjsbv\kivy_43cb622015164809b06a8b1af4948f34\kivy\include\config.pxi
      Updated build\lib.win-amd64-cpython-311\kivy\setupconfig.py
      Updated C:\Users\nadee\AppData\Local\Temp\pip-install-878mjsbv\kivy_43cb622015164809b06a8b1af4948f34\kivy\setupconfig.py
      Detected compiler is msvc
       error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\link.exe' failed with exit code 1104
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for kivy
Failed to build kivy
ERROR: Could not build wheels for kivy, which is required to install pyproject.toml-based projects
vsdwdz23

vsdwdz231#

Kivy无法安装在python 3. 11上,为了安装它,你需要降级到python的较低版本。

isr3a4wc

isr3a4wc2#

Kivy和Python 3.11还没有wheel。你必须从源代码构建Kivy。你可以使用下面的命令来完成。我在一个虚拟环境中做这件事,以保持它与主系统的分离。

python3.11 -m virtualenv Kivy_Py3.11
cd Kivy_Py3.11
source bin/activate
git clone https://github.com/kivy/kivy.git
cd Kivy_py3.11
python -m pip install -e ".[base]"
python -m pip install kivymd
pip freeze

现在将安装Kivy,“pip freeze”应显示:(版本号可能会有所不同)

certifi==2022.12.7
charset-normalizer==2.1.1
docutils==0.19
idna==3.4
-e git+https://github.com/kivy/kivy.git@a7c66880270a93821e1f8ecd613409f008fd2ce8#egg=Kivy
Kivy-Garden==0.1.5
KivyMD==1.1.1
Pillow==9.3.0
Pygments==2.13.0
requests==2.28.1
urllib3==1.26.13

如果你想使用与Python 3.11更兼容的Kivy的夜间构建版本,那么你可以运行这些命令。

python3.11 -m pip install kivy --pre --no-deps --index-url  https://kivy.org/downloads/simple/
python3.11 -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/
python3.11 -m pip install https://github.com/kivymd/KivyMD/archive/master.zip

相关问题