I'm trying to install a python module and get the error
fatal error: Python.h: No such file or directory
# include "Python.h"
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?
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
Unknown package 'python3.6-dev'.
Anyone know where to go from here? I have to be using Python 3 and cannot switch to 2.
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.
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
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