Closed swiss-knight closed 1 month ago
I guess the /home/<username>/Downloads/blender-4.2.2-linux-x64/4.2/python/include/python3.11
is the result of your manual anonymization... ?
Is there a Python.h file there, or in neighbour directories
That's the key issue. Your blender package might lack the Python include files, and there's nothing GDAL can do about that
Your workaround would be to manually copy it there from your system python3-dev package
Or maybe set a CFLAGS environment variable to point to it or hack into GDAL's setup.py to reference it.
Manually copying missing files is likely going to be the easier road
I don't think it is a GDAL bug/responsibility to address that scenario
Thank you @rouault 🙏!
I understand that this may not directly be related to GDAL itself but I wasn't 100% sure.
Yes indeed, I replaced the username by a placeholder.
Then, I cannot find any Python.h
file in the whole Blender installation directory:
~/Downloads/blender-4.2.2-linux-x64$ find . -iname "*Python.h"
=> no results.
So I manually created the directory ~/Downloads/blender-4.2.2-linux-x64/4.2/python/include/python3.11/
and copied there the file /usr/include/python3.11/Python.h
. It solves the current issue. But now I'm facing plenty of others missing header files...
So I basically copied both:
~/Downloads/blender-4.2.2-linux-x64/4.2/python/include$ cp /usr/include/python3.11/*.h ../python3.11/
~/Downloads/blender-4.2.2-linux-x64/4.2/python/include$ cp -R /usr/include/python3.11/cpython/ ../python3.11/
which where needed and then it succeeded compiling:
~/Downloads/blender-4.2.2-linux-x64/4.2/python/bin$ ./pip3 install gdal==3.4.1
Collecting gdal==3.4.1
Using cached GDAL-3.4.1.tar.gz (755 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: gdal
Building wheel for gdal (setup.py) ... done
Created wheel for gdal: filename=GDAL-3.4.1-cp311-cp311-linux_x86_64.whl size=4236286 sha256=6178332f1b6a97a3cb4a6e74ad45685ce21ad1ea0616dd5920c2b0816440e43e
Stored in directory: /home/<username>/.cache/pip/wheels/e9/71/fd/44c1a8ffcf965090e76f303dee7ee88bf5c3ec34d5d2803c90
Successfully built gdal
Installing collected packages: gdal
Successfully installed gdal-3.4.1
Hint: creating a symlink to /usr/include/python3.11/
at the ~/Downloads/blender-4.2.2-linux-x64/4.2/python/
level does also work perfectly. So there is no need to duplicates the header files.
Maybe I shall ping Blender's developers about including Python header files... Done: https://projects.blender.org/blender/blender/issues/128242
Thanks again!
Solved.
What is the bug?
Hello,
I'm in a quite specific case.
I'm trying to install the
gdal
Python package inside the Python (Python 3.11.7 (main, Jun 11 2024, 12:31:01) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] ) which is bundled within Blender 4.2.2 (which I downloaded and unpacked from: https://www.blender.org/download/release/Blender4.2/blender-4.2.2-linux-x64.tar.xz/ )OS: Ubuntu 22.04.5 LTS Native Python: Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
GDAL version on my OS is 3.4.1:
And the dev package is installed:
But I'm facing this error when trying to pip install GDAL, naturally targeting the same version as the OS GDAL library:
prior to that, I did:
I also installed some dev package for Python 3.11 just in case:
But it's not helping.
These are the packages installed locally in Blender
(located in
~/Downloads/blender-4.2.2-linux-x64/4.2/python/lib/python3.11/site-packages/
):If possible, any hints are appreciated.
Thanks a lot!
Steps to reproduce the issue
See above.
Versions and provenance
Installed with
apt
on Ubuntu 22.04.5 LTSAdditional context
No response