skip to Main Content

I tried installing Kivy on a new Windows 11 Installation. Even after I have satisfied the required dependencies, I keep getting an installation error. Below is the response I received.

      Updated buildlib.win-amd64-cpython-311kivyincludeconfig.h
      Updated C:UsersnadeeAppDataLocalTemppip-install-878mjsbvkivy_43cb622015164809b06a8b1af4948f34kivyincludeconfig.h
      Updated buildlib.win-amd64-cpython-311kivyincludeconfig.pxi
      Updated C:UsersnadeeAppDataLocalTemppip-install-878mjsbvkivy_43cb622015164809b06a8b1af4948f34kivyincludeconfig.pxi
      Updated buildlib.win-amd64-cpython-311kivysetupconfig.py
      Updated C:UsersnadeeAppDataLocalTemppip-install-878mjsbvkivy_43cb622015164809b06a8b1af4948f34kivysetupconfig.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

3

Answers


  1. Kivy cannot be installed on python 3.11. In order to install it you need to downgrade to a lower version of python.

    Login or Signup to reply.
  2. There is no wheel for Kivy and Python 3.11 yet.
    You have to build Kivy from source. You can do that using the following commands. I am doing it in a virtual environment to keep it separate from the main system.

    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 will now be installed and the ‘pip freeze’ should show: (version number will probably be different)

    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
    

    If you want to use the nightly build of Kivy that is more compatiable with Python 3.11 then you can just run these command.

    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
    
    Login or Signup to reply.
  3. Run this command:

    python -m pip install kivy --pre --no-deps --index-url  https://kivy.org/downloads/simple/
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search