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

'pip install pywin32' doesn't work #669

Closed
ghost opened this issue Apr 5, 2014 · 28 comments
Closed

'pip install pywin32' doesn't work #669

ghost opened this issue Apr 5, 2014 · 28 comments

Comments

@ghost
Copy link

ghost commented Apr 5, 2014

It would be great if pywin32 could be distributed as a binary wheel. This is the last remaining dependency of Twisted on Windows which requires manual intervention and installation.

Reported by: glyf

Original Ticket: pywin32/bugs/669

@ghost
Copy link
Author

ghost commented Apr 21, 2014

This should be listed as a "Feature Request", rather than a "Bug".

Original comment by: kf7xm

@ghost
Copy link
Author

ghost commented May 15, 2014

I issued a 'Feature Request': https://sourceforge.net/p/pywin32/feature-requests/110/

Original comment by: robi-wan

@ghost
Copy link
Author

ghost commented Jun 16, 2014

Sorry, not packaging for python (bdist_wininst is NOT packaging for python) is a bug.

Original comment by: tritium21

@ghost
Copy link
Author

ghost commented Jun 16, 2014

For what it's worth, python setup.py bdist_wheel almost works. I tweaked the .pth file to append the directories with the DLLs in it to os.environ["PATH"], and everything seems to work reasonably well.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jun 30, 2014

This would probably help solve https://tahoe-lafs.org/trac/tahoe-lafs/ticket/142

Original comment by: zooko

@ghost
Copy link
Author

ghost commented Jul 1, 2014

You can see my binary wheel here: https://glyph.im/pywin32/index/pywin32/index.html

I screwed up the version information (".glyph" is apparently not a valid version suffix) so pip has a little trouble with it, you have to identify it just right to install it, but it otherwise works reasonably well.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Aug 4, 2014

So is there any chance that pywin32 could be installed via pip one day? Problem is that .exe installers couldn't be installed from command line.

Original comment by: stopiccot

@ghost
Copy link
Author

ghost commented Aug 12, 2014

To be clear, there is almost no development work to do here; it is, at most, a one-line change. The issue is that someone with an interest in this problem needs to be granted access to the PyPI packages. I am "glyph" on PyPI and would gladly do the legwork necessary to upload binary wheels that would allow pip to install pywin32. If someone would grant me access to the project I could probably have it done in under a week.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Aug 14, 2014

If it is a matter of volunteers with compilers, count me in.

Original comment by: tritium21

@ghost
Copy link
Author

ghost commented Dec 3, 2014

Since there has been no action on this for over six months, I have created a different distribution on PyPI:

https://pypi.python.org/pypi/pypiwin32

You can "pip install pypiwin32" now into virtualenvs and the like, and that should work.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 8, 2015

I know it's a "slippery slope" type of request, but any chance of Python 3.4 builds as well, Glyph?

It's also worth noting that (as far as I can tell) "wheel convert" on the pywin32 wininst exes works fine as well. So you don't even need a build environment.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 9, 2015

Hi Paul,

I can give you upload credentials to the project on PyPI if that would be helpful.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 9, 2015

Glyph - I'd be happy to wheel convert the existing wininst builds and upload them there. But I just tried to use "pip wheel" to build a Python 3.4 wheel from source, and it failed with errors I don't have time to diagnose. If wheel converted wheels are acceptable, though, I'll take up your offer, thanks.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 9, 2015

What's your PyPI username?

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 9, 2015

Doh. Yeah, that would help - pf_moore.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 9, 2015

Done. You should be able to upload wheels.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 9, 2015

Thanks. Just looking further at the wheel you created for pypiwin32, I see that you have given it a name (in the metadata, as well as the project name) of pypiwin32. Presumably that means that it won't satisfy any dependencies on pywin32 specified in other projects. Was that intentional? I doubt it'll matter though as projects won't be specifying pywin32 as a dependency because of the fact that it's not on PyPI...

One reason I ask is that wheel convert doesn't allow changing the name, so it'll need some extra work to do that. But I'll sort that out and upload the Python 3 wheels.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 9, 2015

OK, we have (minimally tested) Python 3.x wheels uploaded.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 9, 2015

I would certainly have preferred to upload wheels as "pywin32" but a mismatch between what's on PyPI and what's in the wheel itself will break pip. I hope you didn't actually change the name of the wheels? The package still imports under the same name.

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 9, 2015

(If I could upload wheels to pywin32, i would have just done it and we wouldn't be having this conversation :))

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 9, 2015

What I did was "wheel convert pywin32*.exe" which gives wheels called pywin32-bla-blah.whl. I then put together a script that modified those wheels: (a) renamed them to pypiwin32, (b) modified the metadata files to change the project name to pypiwin32, (c) changed the dist-info directory name to pypiwin32.dist-info and (d) patched up the RECORD file to reflect the changes. I also patched the pth file as you did in your wheel (in the process I "accidentally" renamed the pth file to pypiwin32.pth, but that doesn't matter so I left it like that.

I can upload the script somewhere if it's useful to others. It's a bit of a quick hack but it does the job.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 10, 2015

Huh. Where did you get the .exe's? I take it you didn't build them from the sdist I put on pyPI?

Uploading that script and pointing to it from the PyPI page would be helpful, just to facilitate if someone with greater interest wants to maintain it :).

It might also be interesting for me to make the other builds using "wheel convert" rather than my own hackery. However, without changes to the '.pth' files, the wheels won't actually work inside a virtualenv - did you test 'pip install' first? Ideally on a machine without a compiler?

Original comment by: glyf

@ghost
Copy link
Author

ghost commented Jan 10, 2015

I got the exes from here (the official pywin32 ones). I'll find somewhere to put the script and then link to it. Actually, I just made a gist for it - https://gist.github.com/pfmoore/fd09fff11b4fa5f8cb25

I thought I said above - I made the pth file changes in the script too.

For testing I installed in a clean virtualenv (I used pip -vvv to see the details and checked it was using the wheel and not compiling) and then just created a MessageBox. That should confirm the basic functionality. Stuff like COM might not work, because it needs stuff registered with the system, but I suspect that would be true of your build as well (it's what the postinstall script does, and wheel installs don't support postinstall scripts).

If you have a more comprehensive set of tests that your wheel passes, I'll happily run them on my builds.

Original comment by: pmoore

@ghost
Copy link
Author

ghost commented Jan 10, 2015

Hmm, not sure I can add the script link to the PyPI page without putting it into the distribution metadata, which means editing the sources, which (in turn) means having to build from source. So never mind, I'll just leave the link here (above).

Original comment by: pmoore

@ghost ghost assigned ghost and unassigned ghost Oct 24, 2017
jabdoa2 added a commit to missionpinball/mpf that referenced this issue Jan 29, 2018
@Avasam
Copy link
Collaborator

Avasam commented Mar 14, 2024

For what it's worth, python setup.py bdist_wheel almost works.

Note to readers that python setup.py and the use of setup.py as a command line tool are deprecated. pywin32 itself needs to move away from it. #2208

@Avasam
Copy link
Collaborator

Avasam commented Mar 15, 2024

@glyph Is this issue still relevant? Are the current wheels good for Twisted or do you still need anything?

@glyph
Copy link

glyph commented Mar 15, 2024

@Avasam I think that this was fixed quite some time ago, not sure why the issue is still open. pip install pywin32 works pretty much everywhere I try it, so, I think I'm good!

@Avasam
Copy link
Collaborator

Avasam commented Mar 15, 2024

not sure why the issue is still open

That's what I'm working through rn ^^" Lots of old issues migrated from sourceforge.

Thanks for taking the time to answer!

@Avasam Avasam closed this as completed Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants