Python Forum
Python/winrt support for python 3.8 version
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python/winrt support for python 3.8 version
#1
We have module called python/winrt which will be helpful to access the windows runtime apis.

While trying to install the module facing below error.

C:\Users\vpbx\Desktop>pip install winrt
ERROR: Could not find a version that satisfies the requirement winrt (from versions: none)
ERROR: No matching distribution found for winrt

https://pypi.org/project/winrt/

My all Prerequisites are satisfied but still facing the error.
Windows 10, October 2018 Update or later.
Python for Windows, version 3.7 or later
pip, version 19 or later

Will winrt support python3.8 version, if not please explain about the current status that we can expect on python 3.8 version.
Reply
#2
it doesn't specifically say that it supports python 3.8 (shows latest as 3.7) and also states cpython requirement.
also under known issues:
Quote: This release of the Python/WinRT does not support WinRT composable types. This includes most of the classes in the Windows.UI.Composition and Windows.UI.Xaml namespaces. These namespaces are excluded from Python/WinRT.
Note, a few methods in other namespaces reference types in these namespaces. For example, MediaPlayerSurface is in the Windows.Media.Playback namespace but has properties that return types in the Windows.UI.Composition namespace. While these properties are available to Python, accessing them is not supported at this time.
I've had good success installing packages which specify 3.7 on 3.8, but this package might be a bit more fussy.
Best bet is to contact the authoe and ask. (Kenny Kerr Microsoft)
Reply
#3
There is an Issue rapport here.

There are several way you use 3.7 and don't touch your Python 3.8 installation.
Just install python 3.7 from here,do not add to Environment Variables Path.
Then install with py -3.7 -m pip install winrt.
E:\div_code
λ py -3.7 -m pip install winrt
Collecting winrt
  Downloading winrt-1.0.19128.1-cp37-none-win32.whl (4.6 MB)
     |████████████████████████████████| 4.6 MB 2.2 MB/s
Installing collected packages: winrt
Successfully installed winrt-1.0.19128.1

# Test that it work
E:\div_code
λ py -3.7
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import winrt.windows.foundation as wf
>>> 
>>> u = wf.Uri("https://github.com/")
>>> u.host
'github.com'
I still have Python 3.8 as main version in path,but using py can access all other version.
E:\div_code
λ python -V
Python 3.8.3

E:\div_code
λ pip -V
pip 20.1.1 from c:\python38\lib\site-packages\pip (python 3.8)

Using Anaconda example the smaller version Miniconda
This is a stand alone version that are Python 3.7,so here can just install normal with pip.
Do this from Scripts where pip are.
G:\mini_conda37\Scripts
λ pip -V
pip 20.0.2 from G:\mini_conda37\lib\site-packages\pip (python 3.7)

G:\mini_conda37\Scripts
λ pip install winrt
Collecting winrt
  Downloading winrt-1.0.19128.1-cp37-none-win_amd64.whl (3.9 MB)
     |████████████████████████████████| 3.9 MB 1.3 MB/s
Installing collected packages: winrt
Successfully installed winrt-1.0.19128.1

With conda can also create virtual environment for a specific Python version wanted.
conda create -n myenv python=3.7
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Should Python support i suffix for complex numbers as well as j ? stevendaprano 3 1,429 May-21-2022, 08:37 AM
Last Post: stevendaprano
  Is Python Support Graphical User Interface? ankitdixit 4 2,261 Apr-29-2022, 09:26 PM
Last Post: Axel_Erfurt
  Query on choosing Python 3.8.6 version sureshnagarajan 0 1,810 Feb-16-2021, 05:30 AM
Last Post: sureshnagarajan
  Which Python Version? muzikman 15 5,199 Jan-19-2021, 02:16 PM
Last Post: muzikman
  cross-compiling python with zlib support michelebucca 5 5,879 Aug-25-2020, 08:19 PM
Last Post: carterb
  Improved Python support in SonarLint (PyCharm! Eclipse!) ganncamp 0 2,482 Apr-29-2020, 06:25 PM
Last Post: ganncamp
  Issue with 2 version of python (2.6.6 and 2.7) with pip himupant94 2 3,238 Apr-24-2020, 03:23 AM
Last Post: himupant94
  SonarCloud, SonarQube support Python 3.8, add rules for method signature & visibility ganncamp 0 1,753 Mar-31-2020, 04:29 PM
Last Post: ganncamp
  Future of Jython now Python 2 support ended Wattletree 1 2,316 Mar-19-2020, 10:13 PM
Last Post: Larz60+
  How to install the latest version of Python on RHEL 8? devlocalca 7 5,464 Feb-17-2020, 01:49 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020