-
Notifications
You must be signed in to change notification settings - Fork 55
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 failing on python 3.11 #58
Comments
I was having similar problems yesterday. I'll give your solution a try today. Have you tried the more recent versions of pillow with this module? There's a PR that pins pillow at 9.2. |
@wujiaqi I can't figure out what I've done differently between this venv and the successful ones. I've started fresh with a blank venv and only installed cython~=0.29 into the venv. I'm trying the following from within the venv: If you have any ideas, they'd be greatly appreciated! The output: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/pi/src/IT8951
Preparing metadata (setup.py) ... done
Building wheels for collected packages: IT8951
Building wheel for IT8951 (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [54 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-311
creating build/lib.linux-aarch64-cpython-311/IT8951
copying IT8951/interface.py -> build/lib.linux-aarch64-cpython-311/IT8951
copying IT8951/__init__.py -> build/lib.linux-aarch64-cpython-311/IT8951
copying IT8951/constants.py -> build/lib.linux-aarch64-cpython-311/IT8951
copying IT8951/display.py -> build/lib.linux-aarch64-cpython-311/IT8951
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'IT8951.spi' extension
creating build/temp.linux-aarch64-cpython-311
creating build/temp.linux-aarch64-cpython-311/IT8951
arm-linux-gnueabihf-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/pi/.local/share/virtualenvs/PaperPi-VBShxqF-/include -I/usr/include/python3.11 -c IT8951/spi.c -o build/temp.linux-aarch64-cpython-311/IT8951/spi.o
IT8951/spi.c: In function ‘__Pyx_TraceSetupAndCall’:
IT8951/spi.c:22082:37: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
22082 | if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
| ^~
IT8951/spi.c:22084:21: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
22084 | (*frame)->f_trace = Py_None;
| ^~
IT8951/spi.c:438:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
438 | #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
| ^~
IT8951/spi.c:22091:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
22091 | __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
IT8951/spi.c: In function ‘__Pyx_PyBytes_Equals’:
IT8951/spi.c:23312:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations]
23312 | hash1 = ((PyBytesObject*)s1)->ob_shash;
| ^~~~~
In file included from /usr/include/python3.11/bytesobject.h:62,
from /usr/include/python3.11/Python.h:50,
from IT8951/spi.c:6:
/usr/include/python3.11/cpython/bytesobject.h:7:35: note: declared here
7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash;
| ^~~~~~~~
IT8951/spi.c:23313:13: warning: ‘ob_shash’ is deprecated [-Wdeprecated-declarations]
23313 | hash2 = ((PyBytesObject*)s2)->ob_shash;
| ^~~~~
/usr/include/python3.11/cpython/bytesobject.h:7:35: note: declared here
7 | Py_DEPRECATED(3.11) Py_hash_t ob_shash;
| ^~~~~~~~
IT8951/spi.c: In function ‘__Pyx_AddTraceback’:
IT8951/spi.c:438:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
438 | #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
| ^~
IT8951/spi.c:24384:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
24384 | __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for IT8951
Running setup.py clean for IT8951
Failed to build IT8951
ERROR: Could not build wheels for IT8951, which is required to install pyproject.toml-based projects
(PaperPi) 20:30:12 |
@txoof I'm also using a venv. I have the following Cython installed, from And also, when you pass the |
@wujiaqi I think the problem was cython 0.29. For anyone else that stumbles onto this and needs some help with pipenv here are the basic steps:
|
and I just realized that there's a PR out to fix this already #55 |
The PR is quite old and insists that pillow is pinned at v9. I tested it against pillow 10.1 and had no problems. Thanks again for the help. This was driving me mad. |
The fix of using |
Thanks for sharing that. Where I'm stumbling is when a downstream project is trying to include something as a dependency - like in a requirements or setup.py type file. Trying to keep it all "pure python" since the downstream project won't necessarily be cloning from source and be able to run a bash script. Right now I have IT8951 as a dependency in omni-epd, which is in turn used by other projects. Would be nice if this just built properly. Wonder if anyone is maintaining a fork? |
I'm stumbling similarly. My downstream project (PaperPi) requires this and I have to create a bunch of bash to manage the install. |
Hi all,
The only difference in the build process is that now you should install on Raspberry Pi with Hopefully this weekend I will also upload the package to PyPI so you don't have to manually clone the git repository. Thanks for everyone's patience while my life was a bit in chaos ;-) Please let me know if you have any issues with the new build setup! |
I tried doing the
pip install ./
on a fresh raspberry pi OS install and noticed that this is throwing errors. I believe it's due to the API changes in python 3.11, the generated c code is accessing members no longer available https://docs.python.org/3/whatsnew/3.11.html#pyframeobject-3-11-hiding.Update:
When I run this with
USE_CYTHON='USE_CYTHON' pip install ./
to recompile the c code it installs fineThe text was updated successfully, but these errors were encountered: