Kivy cannot be installed because of some errors

0

I am trying to install Kivy but it doesn't install because of this problem given below.

Pastebin Link

Please help regarding this. Thanking you.

I am using pip3 for installing this.

python -m pip install kivy==1.11.1

I have followed every step given on this website.

And as I am unable to post the error here, I have posted on pastebin.com.

Expected behaviour:

The Kivy need to be installed.

Current behaviour:

The Kivy doesn't install and cause problems.

Here is the log when trying to install MS Visual C++ 14.0:

[6198:3BE8][2019-12-29T19:15:17]i108: Detected compatible package: vcRuntimeAdditional_x86, provider: Microsoft.VS.VC_RuntimeAdditionalVSU_x86,v14, installed: {C9DE51F8-7846-4621-815D-E8AFD3E3C0FF}, version: 14.20.27508, chained: {BE960C1C-7BAD-3DE6-8B1A-2616FE532845}
[6198:3BE8][2019-12-29T19:15:17]i103: Detected related package: {C9DE51F8-7846-4621-815D-E8AFD3E3C0FF}, scope: PerMachine, version: 14.20.27508.0, language: 0 operation: Downgrade
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i052: Condition '(windows_uCRT_DetectKeyExists AND windows_uCRT_DetectKey >= v10.0.10137.0)' evaluates to false.
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: vcRuntimeMinimum_x86, state: Obsolete, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: vcRuntimeAdditional_x86, state: Obsolete, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: Windows81_x86, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: Windows81_x64, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: Windows8_x86, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: Windows8_x64, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: Windows7_MSU_x86, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: Windows7_MSU_x64, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: WindowsVista_MSU_x86, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i101: Detected package: WindowsVista_MSU_x64, state: Absent, cached: None
[6198:3BE8][2019-12-29T19:15:17]i052: Condition 'VersionNT >= v6.0 OR (VersionNT = v5.1 AND ServicePackLevel >= 2) OR (VersionNT = v5.2 AND ServicePackLevel >= 1)' evaluates to true.
[6198:3BE8][2019-12-29T19:15:17]i199: Detect complete, result: 0x0
[6198:1334][2019-12-29T19:15:20]e000: Error 0x80070666: Cannot install a product when a newer version is installed.

Sorry for posting here, as I don't know where to ask this question.

Have I created the question on correct place?

windows
python
asked on Super User Dec 29, 2019 by sairam kumar • edited Dec 29, 2019 by Anaksunaman

1 Answer

1

pip pulls from PyPI and, at the time of this writing, Kivy 1.11.1 on PyPI only has wheels for Python 2.7 and 3.5 - 3.7.

Based on your Pastebin output, you appear to be using Python 3.8. This means that Python cannot use any of the pre-built wheels from PyPI right now. And pip appears to be running into issues compiling Kivy from scratch for Python 3.8 (which is not unusual for more complex projects/modules on Windows).

As a general recommendation, you should consider using a current version of e.g. Python 3.7 (ex. Python 3.7.6) with Kivy, as this should solve the problems you are encountering with little additional effort.


Multiple Python Installations

On Windows, you can have multiple versions of Python installed without one installation affecting the other(s). Simply install the additional version of Python you wish to use via the normal installation process (e.g. with the vanilla installer from python.org linked above).

Caveats

However, with that said, there are some things to be aware of:

  • To ensure there are no issues, you may want to consider using the custom installation option rather than the default "simple" installation.

  • A particular branch of Python will generally use the same default folder (e.g. Python37-32, Python38-32, etc).

    Since you intend on using different versions of Python, this probably won't be an issue. But be aware that you can change the default installation folder for Python as necessary (under the custom installation options).

  • Only one version of Python can reside in your Windows environment path at a time (i.e. be accessible by simply using python).

    You will need to refer to any other version currently not in your path by its full path (e.g. C:\path\to\Python37\python.exe) or use other means to reference the appropriate python.exe (see the notes at the end of this answer).

  • Similarly, only one version of pip can reside in your Windows environment path at a time.

    If you wish to use the version of pip associated with a particular version of Python (necessary for installing modules correctly), I would suggest using python -m pip rather than just pip. So to install Kivy, you might use e.g. C:\path\to\Python37\python.exe -m pip install Kivy.

  • There may be a disconnect between the version of Python associated with your .py file extension and the version available from the command line (using python).

    This isn't a real issue, but this situation can cause module not found errors. So you may need to either (re-)associate the .py file extension with the default installation of Python you wish to use or explicitly invoke scripts with the correct Python version (e.g. C:\path\to\Python37\python.exe script.py).


Referencing Another Python Version

If you want to use multiple versions of python/pip at the command line without using a full path, there are several ways to get around this requirement.

Option 1

Use the Python Launcher for Windows (py.exe), which is typically installed by default with vanilla Python on Windows. You can verify if py.exe is installed and in your environment path by running:

where py

Assuming where returns a path (and not INFO: Could not find files for the given pattern(s)), you could then interact with Python 3.7 with ex. py -3.7 script.py. And to install Kivy into Python 3.7 via py.exe:

py -3.7 -m pip install Kivy

Option 2

Create .bat files referencing the proper locations (which also capture any command line arguments) and place those in your environment path e.g.:

ex. python37.bat

C:\path\to\Python37\python.exe %*

and

ex. pip37.bat

C:\path\to\Python37\Scripts\pip.exe %*

These .bat files could then be used accordingly ex. python37 script.py. To install Kivy with these batch files:

python37 -m pip install Kivy

or alternately:

pip37 -m pip install Kivy

Option 3

Add e.g. C:\path\to\Python37 to your Windows environment variables (ex. during installation) and then rename python.exe and pip.exe in your Python 3.7 folder and Python 3.7 Scripts folder (respectively). You could then (again) use something like e.g. python37.exe and pip37.exe at the command line for Python 3.7.

While there aren't many issues issues with this method, one drawback is that Python itself likely won't be able to upgrade/remove these irregularly named files in the future (you will need to take extra steps in those cases).

answered on Super User Dec 29, 2019 by Anaksunaman • edited Jun 12, 2020 by Community

User contributions licensed under CC BY-SA 3.0