Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package install fails with Python 3.8 #634

Closed
jo6pak opened this issue Feb 12, 2020 · 23 comments
Closed

Package install fails with Python 3.8 #634

jo6pak opened this issue Feb 12, 2020 · 23 comments
Assignees

Comments

@jo6pak
Copy link

jo6pak commented Feb 12, 2020

C:\Users\AppData\Local\Programs\Python\Python38\Scripts>pip install winrt

ERROR: Could not find a version that satisfies the requirement winrt (from versions: none)
ERROR: No matching distribution found for winrt

I tried this package a few months ago with Python3.7 and it used to work fine

@kennykerr
Copy link
Contributor

Unfortunately, the Python project is not currently in a usable state.

@BenJKuhn BenJKuhn self-assigned this May 1, 2020
@BenJKuhn BenJKuhn reopened this May 1, 2020
@BenJKuhn
Copy link
Member

BenJKuhn commented May 1, 2020

Reopening this based on additional recent feedback. If you're using pywinrt and are interested in an update for 3.8, please do chime in. We'd like to understand if this is still valuable to the community.

Thanks,

Ben

@freakboy3742
Copy link

Chiming in as the source of the "additional recent feedback" 😃

My own interest comes from the BeeWare project, and Toga specifically. Toga is a cross-platform native widget library; as such, it needs access to system GUI libraries.

To date, we've been using Python for .net. However, that project seems to be having some maintenance problems. They don't have a Python 3.8 release either (and their Python 3.7 support took a long time to land). They're also a volunteer-driven project, so some lag in support is not entirely unexpected.

As an official Microsoft-released library, winrt looked like a promising alternative when it was announced. However, only having a published wheel for Python 3.7 immediately removed it from consideration for our purposes. The fact that it hasn't been updated in the year since it was initially announced reinforces that. I would suspect that my reasoning is not alone in the Python community.

Being able to bridge to system libraries is one of those chicken-and-egg projects - it's not really useful until potential users know the capability exists, is reliable, and is well maintained. People can't build tools that utilize Windows system libraries until a reliable bridge exists. If the bridge-builders are waiting for the community to express an interest before they build - well... we've got a problem.

Toga is able to support macOS, iOS, Linux and Android using officially published, well maintained, manufacturer provided Python language bridges, or with a relatively thin wrapper around a manufacturer provided low-level bridges like FFI or JNI. I don't use Windows on a daily basis, but I want to provide better support for Windows in BeeWare. The lack of a well supported bridge or language projection for Windows is the biggest impediment to providing robust Windows support.

@Joetib
Copy link

Joetib commented May 2, 2020

Chiming in as well
Pywinrt is a valuable asset because bridging to system libraries is always something we are going to do. And if the system providers kill their own support then which other project can we trust to always be there?

@iyanuashiri
Copy link

👍

@michela
Copy link

michela commented May 3, 2020

👍🏽

@bburky
Copy link

bburky commented May 3, 2020

I recently discovered Python/WinRT but I found it a very nice way to access things like the camera with native device APIs. I'm glad to hear you're considering continuing development of it.

Here's a small test project where I managed to use it to capture images using the camera of my Windows tablet:
Python WinRT Image Capture (and Focus Stacking)

I actually found Python/WinRT a very easy to use API. I was very happy I could just do a Python await on the native APIs. The only real issue I ran into I think was the inability to configure the apartment type, I think a few of the camera APIs required an STA apartment type. I also couldn't figure out how to cast WinRT objects in Python.

@FlipperPA
Copy link

We would use this functionality to write addons for games like Rift.

@stonebig
Copy link

stonebig commented May 3, 2020

droping winrt for 3.8 was a bit of an unexpected move.

@dlech
Copy link
Contributor

dlech commented May 20, 2020

Unfortunately, the Python project is not currently in a usable state.

What needs to be done to get it back in usable state?

@BenJKuhn
Copy link
Member

Thank you everyone for all the great feedback. It's clear there's still healthy interest in this, so we'll try to get an update out for 3.8 as soon as practical!

@vlovich
Copy link

vlovich commented Jun 18, 2020

What versions of python ARE supported? I've tried the same thing on python3.6 & python2.7 & get the same error message. It's useful to be able to quickly prototype some APIs.

@jo6pak
Copy link
Author

jo6pak commented Jun 18, 2020

What versions of python ARE supported? I've tried the same thing on python3.6 & python2.7 & get the same error message. It's useful to be able to quickly prototype some APIs.

Used to work with Python 3.7.

@vlovich
Copy link

vlovich commented Jun 18, 2020

That worked. Thanks! Kind of surprising it only works with 1 specific version of python & that's not mentioned anywhere on the pypi page.

@DODRO35
Copy link

DODRO35 commented Jun 22, 2020

Would it be possible to have an estimated time before we can use it with Python 3.8?

@sander76
Copy link

I'd love to see this too. I just ran into winrt for python only to see it hasn't seen a new release for over a year. Is python for winrt dead ?

@Kevin-Taha
Copy link

Kevin-Taha commented Jun 23, 2020

A 3.x+ package is WIP. The tools required to build and package an updated module are open sourced in this repo, but some things seem to be a little atrophied. Some work on the CMake scripts for packaging may have to be done to get it going again. What's on PyPi right now will only support 3.7 - I don't particularly know why it was only scoped into that version - but adjusting that should only be some metadata work.

@sahikon
Copy link

sahikon commented Jul 11, 2020

@KevinTXY

A 3.x+ package is WIP.

I assume that this will also allow to build Python/WinRT with the latest Cpp/WinRT, right?

I.e.,

  1. https://github.com/microsoft/xlang/tree/master/src/package/pywinrt/projection
  2. generate.ps1 -clean
  3. generate.ps1 -fullProjection
  4. build.ps1

Thanks in advance for clarification.

@BenJKuhn
Copy link
Member

So, long story short, the way this projection is built, it's inherently going to need to be rebuilt for each version of python 3.x and re-uploaded. I've updated our build config, rebuilt, and posted the 3.8 binaries to PyPi. I've done some basic smoke testing, but there was some meaningful code churn to get this running again, and I haven't had a chance to re-test thoroughly. Please file new issues if you run into any problems with the 3.8 update.

@bstarbuck3
Copy link

So no python winrt for 3.10?

@ArjixWasTaken
Copy link

Hello @BenJKuhn!
Could you please setup a github action that builds a wheel for each python version?

That would make it easier for people to just fork the repo, edit the workflow task to support more python versions and create a PR.

@dlech
Copy link
Contributor

dlech commented Mar 2, 2022

FYI, I've created a community fork that has Python 3.10 binary wheels, many bug fixes, type hints and other improvements.

https://pypi.org/project/winsdk/

@ArjixWasTaken
Copy link

FYI, I've created a community fork that has Python 3.10 binary wheels, many bug fixes, type hints and other improvements.

https://pypi.org/project/winsdk/

Exactly what I was looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests