Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AWald2
Beginner
3,155 Views

Python.h not found but python-dev installed

I'm trying to install a python module and get the error

fatal error: Python.h: No such file or directory

# include "Python.h"

^

compilation terminated.

but when I enter

sudo opkg install python-dev

as recommended by other posts, I get

Package python-dev (2.7.3-r0.3) installed in root is up to date.

so why is Python.h not found and why can't I install my package?

Tags (1)
0 Kudos
6 Replies
KMill10
Valued Contributor II
164 Views

Have you tried:

# include

instead of

# include "Python.h"

AWald2
Beginner
164 Views

After reading around some more I think it's because I'm trying to install with Python 3, but my python-dev is for Python 2. I tried to do

sudo opkg install python3.6-dev

but get

Unknown package 'python3.6-dev'.

Anyone know where to go from here? I have to be using Python 3 and cannot switch to 2.

idata
Community Manager
164 Views

Hi Ayw,

 

 

Thank you for using the Intel Edison, I hope you're having a good time with it.

 

I'm wondering if you have checked this tutorial to install Python 3.6, https://software.intel.com/en-us/blogs/2017/02/07/installing-python-36-on-your-intel-edison https://software.intel.com/en-us/blogs/2017/02/07/installing-python-36-on-your-intel-edison. I would suggest you to give a try and then let us know how that goes.

 

 

Regards,

 

Pablo M.
AWald2
Beginner
164 Views

Yes, those are the instructions I already followed to install Python 3.6, which was successful. I am now trying to install the module pymodbus3 and have run into the error above. I am looking for a way to get a python 3 version of python-dev to use rather than the python 2.7 version already installed

idata
Community Manager
164 Views

Hi Ayw,

 

 

I did some quick research on your question and didn't find anything related to python-dev on Edison. Another option would be to try installing it from source, however, I wasn't able to find the source code for this package.

 

If you get to find it yourself, the steps to install from source are similar to the ones below:
  • Download the package, it should be a tar file (or a compressed file)
  • Unzip the package
  • Go into the main unzipped folder using cd
  • Run the configure file with ./configure
  • Run make
  • Run make install
Again, you should first find the package and download it, which I wasn't able to do. You can also check this thread https://stackoverflow.com/questions/27072734/python-dev-installation-without-package-management https://stackoverflow.com/questions/27072734/python-dev-installation-without-package-management.

 

 

Regards,

 

Pablo M.

 

idata
Community Manager
164 Views

Hi Ayw,

 

 

Don't hesitate to contact us back if you have any other question related to the Edison platform.

 

 

Regards,

 

Pablo M.
Reply