-Wall -I/usr/include/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5m.a -lpython35 -o prime_numbers_2 prime_numbers_2.cprime_numbers_2.c:11:20: fatal error: Python.h: No Such File ordirectory compilation terminated.I also search in the directory /usr/lib with the following command:

find . -name Python.hbut there is no Python.h in that directory.

You are watching: Fatal error: python.h: no such file or directory

How can I fix these problems? Should I reinstall Python3.5.2?


python3
Share
Improve this question
Follow
edited Aug 31 "16 at 10:58
user308164
asked Aug 31 "16 at 9:51
*

PaulTsaiPaulTsai
11522 gold badges66 silver badges1111 bronze badges
Add a comment |

1 Answer 1


Active Oldest Votes
16
You should install the development package of Python which contains header files and the library of Python.

sudo apt-get install python3-devSources:


Share
Improve this answer
Follow
edited Aug 31 "16 at 12:15
answered Aug 31 "16 at 9:59
*

MelebiusMelebius
10.1k77 gold badges4141 silver badges6868 bronze badges
4
Add a comment |

Your Answer


Thanks for contributing an answer to Ask Ubuntu!

Please be sure to answer the question. Provide details and share your research!

But avoid

Asking for help, clarification, or responding to other answers.Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

See more: I Just Realized Anna Kendrick Tina Fey Carolina Herrera Fashion Show 02


Draft saved
Draft discarded

Sign up or log in


Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Submit

Post as a guest


Name
Email Required, but never shown


Post as a guest


Name
Email

Required, but never shown


Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy


Not the answer you're looking for? Browse other questions tagged python3 or ask your own question.


The Overflow Blog
Featured on Meta
Related
0
Python 3.5 is unable to access packages installed with pip3 like django
1
Installing Kivy ubuntu 16.04 64-bit
2
fatal error: Python.h: No such file or directory (Unsolved with python-devel)
0
Python’: No such file or directory
1
whereis python3 gives several paths
Hot Network Questions more hot questions

Question feed
Subscribe to RSS
Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader.


*

lang-py
Ask Ubuntu
Company
Stack Exchange Network
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev2021.9.10.40187


Ubuntu and Canonical are registered trademarks of Canonical Ltd.
Ask Ubuntu works best with JavaScript enabled
*

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.