Ask Ubuntu Asked by hhg on January 3, 2022
I just switched to Linux (Ubuntu 20.04) from Windows. After installing python-dev I notice that Python.h is still not included, which breaks my integrated Python-C++ build (I’m using pybind11). I also tried to install every other variant of python-dev I saw mentioned online (python3-dev, python-devel, etc.) but to no avail.
Interestingly, installing python3-dev on Ubuntu 18.04 includes this file and everything works.
Might this be a bug in the 20.04 version?
Try installing the package libpython3.8-dev, that should put the Python.h file into /usr/include/python3.8/Python.h
Use apt-file search Python.h to find the packages that contain it. After installing apt-file, you will need to run apt-fil update to let it update its database.
Answered by ubfan1 on January 3, 2022
You can try the following:
sudo updatedb
locate Python.h
Output:
/usr/include/python2.7/Python.h
/usr/include/python3.5m/Python.h
Then set
export CPATH=/usr/include/python3.5m:$CPATH
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
Answered by turbulence on January 3, 2022
1 Asked on December 7, 2020 by rozana-alam
0 Asked on December 6, 2020 by lelorrain
0 Asked on December 5, 2020 by martin-andersen
3 Asked on December 5, 2020 by shantanu
1 Asked on December 5, 2020 by yuvarajesh-valleru
0 Asked on December 5, 2020 by curiousstudent
1 Asked on December 4, 2020
0 Asked on December 4, 2020 by lynac
2 Asked on December 4, 2020 by user1079583
1 Asked on December 4, 2020 by valrie-bibeau
0 Asked on December 4, 2020 by paul-reyes
3 Asked on December 3, 2020 by ujjal-das
0 Asked on December 3, 2020 by fastonkill
1 Asked on December 3, 2020 by limp_chimp
3 Asked on December 3, 2020 by cyberquarks
1 Asked on December 2, 2020 by phoenixblue
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP