How to rebuild a Python module/library [closed]
Asked Answered
D

1

-1

I'm trying to rebuild the pyhook libary as described in this answer here.

Basically, I need to change a few lines of the C code for the pyhook module.

The problem is I don't know how to access the C code or how to rebuild the libary.

I've heard of Cython but I don't understand it and I don't know how to use it.

Also, I would like the solution to be compatible with py2exe.

Danette answered 18/2, 2016 at 2:34 Comment(0)
O
2

You need to download the C code first - it's not part of the exe install. Unzip it and you then have a source tree that will build.

To build it you'll need a C compiler. You need to use the SAME ONE as your Python version for your platform. For example, for Windows and Python 3.5 you need the latest Visual C from Microsoft.

For pyHook you also need SWIG. Use that to construct cpyHook_wrap.c from the supplied cpyHook.i

Then run setup.py and you should be good to go.

Ornamental answered 18/2, 2016 at 9:7 Comment(2)
Is it possible to do this without a ressource consuming program (Visual C)? Do C compilers exist on their own and would they work?Danette
You need to use the same compiler as the version of python you are using. The visual C compiler is not big but I don't know how to install it on its own.Ornamental

© 2022 - 2024 — McMap. All rights reserved.