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

"Python.h no such file or directory" error on compilation of freecad/freecad/[email protected] #475

Closed
kaczuch opened this issue Mar 1, 2024 · 2 comments

Comments

@kaczuch
Copy link

kaczuch commented Mar 1, 2024

When trying to install freecad with:
brew install freecad
or just med-file dependency with:
brew install med-file
I got error when building
[ 96%] Building CXX object python/CMakeFiles/_medenumtest.dir/med/medenumtest_modulePYTHON_wrap.cxx.o cd /tmp/med-fileA4.1.1-20240302-33450-jfibmu/med-4.1.1/build/python && /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/g++-13 -DH5_BUILT_AS_DYNAMIC_LIB -DH5_USE_16_API -DH5_USE_18_API -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200809L -D_medenumtest_EXPORTS -I/home/linuxbrew/.linuxbrew/include/python3.12 -I/tmp/med-fileA4.1.1-20240302-33450-jfibmu/med-4.1.1/include -I/tmp/med-fileA4.1.1-20240302-33450-jfibmu/med-4.1.1/build/include -O3 -DNDEBUG -fPIC -MD -MT python/CMakeFiles/_medenumtest.dir/med/medenumtest_modulePYTHON_wrap.cxx.o -MF CMakeFiles/_medenumtest.dir/med/medenumtest_modulePYTHON_wrap.cxx.o.d -o CMakeFiles/_medenumtest.dir/med/medenumtest_modulePYTHON_wrap.cxx.o -c /tmp/med-fileA4.1.1-20240302-33450-jfibmu/med-4.1.1/build/python/med/medenumtest_modulePYTHON_wrap.cxx /tmp/med-fileA4.1.1-20240302-33450-jfibmu/med-4.1.1/build/python/med/medenum_modulePYTHON_wrap.cxx:168:11: fatal error: Python.h: No such file or directory 168 | # include <Python.h> | ^~~~~~~~~~ compilation terminated.
My system is Kubuntu 22.04
I don't know how brew manages its dependencies, but I've tried to reinstall python with brew reinstall python.

@ipatch
Copy link
Collaborator

ipatch commented Mar 2, 2024

i've run into this issue on linuxbrew as well. the homebrew-freecad formula file of med is built against the upstream homebrew version of [email protected]. i believe homebrew recently switched to [email protected] as the main / primary version of python. and in the past when i have run into similar issues it is because [email protected] is linked in your cellar (if memory serves me correctly) so maybe try unlinking whatever version of python you have linked in your cellar, and make sure to have [email protected] linked.

if the issue still persists i'll try and replicate locally on my system.

@ipatch
Copy link
Collaborator

ipatch commented Mar 5, 2024

#478

the above pr should resolve the Python.h error mentioned above. tested it with the github hosted runners. also tested it with my local linuxbrew install with [email protected] linked in my Cellar, and the install is able to build the necessary python module.

going to close this issue now, but if the issue is still persisting please comment below.

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

No branches or pull requests

2 participants