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

pyWinhook fails to build when installing PsychoPy 3.0.2 #2222

Closed
dvbridges opened this issue Jan 18, 2019 · 23 comments

Comments

@dvbridges
Copy link
Contributor

commented Jan 18, 2019

When performing developers install for PsychoPy 3.0.2 on Windows 10, the installation fails due to a pyWinhook build failure:

error: command 'swig.exe' failed: No such file or directory

@dvbridges dvbridges changed the title pyWinhook fails to install build when installing PsychoPy 3.0.2 pyWinhook fails to build when installing PsychoPy 3.0.2 Jan 18, 2019

@dvbridges

This comment has been minimized.

Copy link
Contributor Author

commented Jan 18, 2019

Fixed by downloading SWIG and adding path of swig.exe to environment variables.

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

We previously didn't have pyHook or pyWinhook listed as package requirements probably for this reason. :\ When py(Win)hook's setup.py is called, it invokes swig to compile the C bindings.

For what it's worth, I created conda packages, so in case you fancy using a conda environment, simply do conda install -c conda-forge pywinhook.

So this is not a bug, but simply the pyWinhook devs failing to provide wheels for modern Python distributions via PyPI, so pip is forced to compile it from source.

On another side node, you now probably ended up with a non-functional pyWinhook installation, as the latest release does not support Python 3… :S My conda package, however, contains the appropriate patch.

@peircej

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

Luckily I didn't change it in the standalone as far as I know (hoping it didn't update and break itself automatically during build)!

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

(This was actually part of the things that made me wonder if we shouldn't factor out the iohub deps into an extra, but there's pros and cons for both approaches)

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 18, 2019

Luckily I didn't change it in the standalone as far as I know (hoping it didn't update and break itself automatically during build)!

If you installed it manually via a wheel or exe like always, I don't think pip or setuptools would attempt to fetch / compile it again from the web, so all should be good I guess?

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 24, 2019

The pyWinhook maintainer has merged my PR adding Py3 support, and drafted a new release including wheels for Py 2.7 and 3.7: https://github.com/Tungsteno74/pyWinhook/releases/tag/1.6.0
Hope this will be published on PyPI soon.

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 24, 2019

Hey @dvbridges, the new builds are now available from PyPI: https://pypi.org/project/pyWinhook/1.6.0/#files

I will try to build and upload a Py 3.6 build as well when I have time.

I believe this closes this issue!

@dvbridges

This comment has been minimized.

Copy link
Contributor Author

commented Jan 24, 2019

Cool, cheers @hoechenberger.

@dvbridges dvbridges closed this Jan 24, 2019

@peircej

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

Does this have any benefits over the pyHook that I was providing already? ie. Should I be updating the standalone to use this instead?

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

@peircej I don't know where you acquired pyHook for Python 3, probably from https://www.lfd.uci.edu/~gohlke/pythonlibs/? Because there are no official releases supporting Py3. My patches have added Py3 support to pyWinhook and the maintainer published fresh wheels, so installing via PyPI should now be easier (no compilation required, at least for Py 3.7, but will add 3.6 soon too).

But to answer your question, I don't think there would be much of a benefit for you to switch from pyHook to pyWinhook in standalone, as long as it works with Py3 anyway. – No benefit apart from you being able to pip install that dep for Py3 from PyPI and without compilation, that is.

@peircej

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

Yes, I think I got it from gohlke
OK, will leave for now. thanks!

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Jan 25, 2019

Py3.6 wheels now available from PyPI.

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Feb 10, 2019

Meanwhile, pyWinhook 1.6.1 has been released. It contains fixes for unicode handling in window names, thereby providing an actual advantage over pyHook. Wheels for Python 2.7 and 3.7 are on PyPI, and I will publish Python 3.6 binaries tomorrow or so.

@dvbridges

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2019

I am having problems installing PyWinHook using wheels. I get the following:

pyWinhook-1.6.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

The installation from the developer repo also fails because the PyWinHook build fails for reason above (swig).

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Mar 11, 2019

@dvbridges

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2019

Using Windows 10 64-bit

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Mar 11, 2019

There are currently no Py3.6 wheels for pyWinhook 1.6.1 on PyPI (only for 2.7 and 3.7). I can try to publish some later tonight. In the meantime, you could use pyWinhook 1.6.0.

@dvbridges

This comment has been minimized.

Copy link
Contributor Author

commented Mar 11, 2019

Ah I see. No worries. I will switch to Py3.7 and go from there.

@hoechenberger

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

@dvbridges I just published a Py3.6 wheel on PyPI.

@dvbridges

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2019

Thanks @hoechenberger !

@mpratt14

This comment has been minimized.

Copy link

commented Apr 5, 2019

@hoechenberger @peircej I just tried to install psychopy using pip on Python 2.7 and I have exactly this issue

pip printed the following
Collecting pyWinhook (from psychopy) Downloading https://files.pythonhosted.org/packages/a7/ec/f3a1190aa76f59a20ef7b8b9aebd1c60ffd0a9d4c1b5a18ce27cc1b34ae0/pyWinhook-1.6.1.zip

So is there a way I can skip this requirement, or install it another way with a different version?

EDIT:
I have never heard of wheels before but I see they are easy to install

I found the latest wheel here:
https://github.com/Tungsteno74/pyWinhook/releases/download/1.6.1/pyWinhook-1.6.1-cp27-cp27m-win_amd64.whl

@mpratt14

This comment has been minimized.

Copy link

commented Apr 5, 2019

But I got the same thing ....

pyWinhook-1.6.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

I am also running Windows 10 64-bit but I have installed 32-bit python...

@mpratt14

This comment has been minimized.

Copy link

commented Apr 5, 2019

I ended up getting swig and VC++ for python

if anyone needs the wheel for pyWinhook 1.6.1 for Python 2.7 Windows 32-bit:
https://gist.github.com/mpratt14/67a7418900566e58391b9be01fdcc9b4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.