You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: This discussion was originally posted to the ISSM Forum, which has been decommissioned. It is reproduced here for reference. Please start a new Discussion or Issue if you wish to ask something related to this discussion.
weiji14
Hi there,
I saw in the changelog that ISSM version 4.16 has added support for Python 3, but am getting an error when compiling from the SVN source (revision 24493) that appears to be Python 2 related. I've got a Github gist to reproduce this.
configure: ============================================================================
configure: = Checking ISSM specific options =
configure: ============================================================================
checking for date... /bin/date
checking for build date... Fri Mar 20 01:40:46 UTC 2020
checking user name... jovyan
checking host full OS name and version... linux
checking host cpu... x86_64
checking vendor... pc
checking host OS name... linux
checking host OS version... 4.15.0-92-generic
checking host OS architecture... x86_64
checking for debugging support... yes
checking for development support... yes
checking for standalone modules build... no
checking for standalone executables build... no
checking for standalone libraries build... no
checking for wrappers compilation... yes
checking for vendor compilers... done
checking whether matlab is enabled... no
checking Checking if this is a Win build... ... done
checking for javascript... no
checking for triangle... yes
checking for boost... no
checking for dakota... no
checking for python... yes
checking for python version... File "<string>", line 1
import sys; print sys.version[:3]
^
SyntaxError: invalid syntax
checking for python header file Python.h... configure: error: Python.h not found, locate this file and contact ISSM developers
The above error happens when I set the configure script's --with-python-dir= setting to a Python 3 path, and it seems to be hardcoded to point to Python 2 header files. If I set the path to point to Python 2 on /usr, the configure script works, but a different error pops up during the make stage. Is it possible to get a fully Python 3 installation working?
bdefleurian
Hei weiji
This is related to the way in which ISSM deals with its install and looks for the Python.h path. If you want to point to your proper Python3 install you should add the following line to your configure.sh: --with-python-version=3.X \ X being the minor of your Python install. Be sure also that the Python 3 you installed is a dev version and includes the Python.h file
weiji14
Excellent! The configure script worked after installing python3-dev (on an Ubuntu build) and using the two lines below:
I'm now getting another error in the make stage though (the same one I saw when using Python 2). The error message is as follows:
Making all in wrappers
make[3]: Entering directory '/home/jovyan/trunk/src/wrappers'
Making all in python
make[4]: Entering directory '/home/jovyan/trunk/src/wrappers/python'
CXX io/libISSMPython_la-WritePythonData.lo
CXX io/libISSMPython_la-CheckNumPythonArguments.lo
CXX io/libISSMPython_la-FetchPythonData.lo
CXX io/libISSMApi_la-ApiPrintf.lo
CXX ../BamgConvertMesh/BamgConvertMesh_python_la-BamgConvertMesh.lo
CXX ../BamgTriangulate/BamgTriangulate_python_la-BamgTriangulate.lo
CXX ../BamgMesher/BamgMesher_python_la-BamgMesher.lo
CXX ../ContourToMesh/ContourToMesh_python_la-ContourToMesh.lo
In file included from /usr/include/python3.6/Python.h:8:0,
from ./io/./../include/pythonincludes.h:20,
from ./io/./pythonio.h:14,
from ./io/FetchPythonData.cpp:14:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:1398: recipe for target 'io/libISSMPython_la-FetchPythonData.lo' failed
make[4]: *** [io/libISSMPython_la-FetchPythonData.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from /usr/include/python3.6/Python.h:8:0,
from ../BamgTriangulate/./.././python/include/pythonincludes.h:20,
from ../BamgTriangulate/./../bindings.h:11,
from ../BamgTriangulate/./BamgTriangulate.h:19,
from ../BamgTriangulate/BamgTriangulate.cpp:4:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/python3.6/Python.h:8:0,
from ./io/./../include/pythonincludes.h:20,
from ./io/./pythonio.h:14,
from ./io/CheckNumPythonArguments.cpp:8:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/python3.6/Python.h:8:0,
from ../BamgConvertMesh/./.././python/include/pythonincludes.h:20,
from ../BamgConvertMesh/./../bindings.h:11,
from ../BamgConvertMesh/./BamgConvertMesh.h:19,
from ../BamgConvertMesh/BamgConvertMesh.cpp:4:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/python3.6/Python.h:8:0,
from ./io/./../include/pythonincludes.h:20,
from ./io/./pythonio.h:14,
from ./io/ApiPrintf.cpp:11:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:1265: recipe for target '../BamgTriangulate/BamgTriangulate_python_la-BamgTriangulate.lo' failed
make[4]: *** [../BamgTriangulate/BamgTriangulate_python_la-BamgTriangulate.lo] Error 1
Makefile:1391: recipe for target 'io/libISSMPython_la-CheckNumPythonArguments.lo' failed
make[4]: *** [io/libISSMPython_la-CheckNumPythonArguments.lo] Error 1
Makefile:1377: recipe for target 'io/libISSMApi_la-ApiPrintf.lo' failed
make[4]: *** [io/libISSMApi_la-ApiPrintf.lo] Error 1
Makefile:1251: recipe for target '../BamgConvertMesh/BamgConvertMesh_python_la-BamgConvertMesh.lo' failed
make[4]: *** [../BamgConvertMesh/BamgConvertMesh_python_la-BamgConvertMesh.lo] Error 1
In file included from /usr/include/python3.6/Python.h:8:0,
from ../ContourToMesh/./.././python/include/pythonincludes.h:20,
from ../ContourToMesh/./../bindings.h:11,
from ../ContourToMesh/./ContourToMesh.h:20,
from ../ContourToMesh/ContourToMesh.cpp:6:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/include/python3.6/Python.h:8:0,
from ./io/./../include/pythonincludes.h:20,
from ./io/./pythonio.h:14,
from ./io/WritePythonData.cpp:14:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:1279: recipe for target '../ContourToMesh/ContourToMesh_python_la-ContourToMesh.lo' failed
make[4]: *** [../ContourToMesh/ContourToMesh_python_la-ContourToMesh.lo] Error 1
Makefile:1384: recipe for target 'io/libISSMPython_la-WritePythonData.lo' failed
make[4]: *** [io/libISSMPython_la-WritePythonData.lo] Error 1
In file included from /usr/include/python3.6/Python.h:8:0,
from ../BamgMesher/./.././python/include/pythonincludes.h:20,
from ../BamgMesher/./../bindings.h:11,
from ../BamgMesher/./BamgMesher.h:22,
from ../BamgMesher/BamgMesher.cpp:4:
/usr/include/python3.6/pyconfig.h:3:12: fatal error: x86_64-linux-gnu/python3.6m/pyconfig.h: No such file or directory
# include <x86_64-linux-gnu/python3.6m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:1258: recipe for target '../BamgMesher/BamgMesher_python_la-BamgMesher.lo' failed
make[4]: *** [../BamgMesher/BamgMesher_python_la-BamgMesher.lo] Error 1
make[4]: Leaving directory '/home/jovyan/trunk/src/wrappers/python'
Makefile:465: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/jovyan/trunk/src/wrappers'
Makefile:463: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/jovyan/trunk/src'
Makefile:584: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/jovyan/trunk'
Makefile:481: recipe for target 'all' failed
make: *** [all] Error 2
This forum post suggests that installing libpython3-dev will provide the missing pyconfig.h file, but I'm pretty sure that installing python3-dev automatically installs libpython3-dev. Is there an extra setting I need to make to fix this?
bdefleurian
Hei
I am not sure about this one. Have you checked that pyconfig.h is actually here. It seems that it is the case. Could you post your configure.sh file and let me know what is your installation routine (I guess the one of the website).
weiji14
Hi,
Been trying several combinations today but no luck so far. The pyconfig.h file is definitely there in /usr/include so I'm not sure what's wrong. The compilation command I'm using is a bit different to the one on the website and goes like this:
and I've posted two files up as a Github gist - configure and Makefile, plus a Dockerfile with the above code. Let me know if you need any other log files and I'll upload them for you.
bdefleurian
So looking at it and comparing with my install I see two possible issues. The first one is the less likely to do anything but I see that your numpy points to a 3.7 Python, that might be an issue.
For the problem at hand, could you check that you also have a pyconfig.h in /usr/include/x86_64-linux-gnu/python3.6m/, it seems that the usr/includepyconfig.h tries to grab this one.
weiji14
Yes, pyconfig.h is present:
$ ls -l /usr/include/x86_64-linux-gnu/python3.6m/
total 44
-rw-r--r-- 1 root root 44045 Nov 7 10:44 pyconfig.h
I'll see if numpy is the issue, give me a few minutes. Edit: Nope, using system apt installed numpy (Python 3.6) still shows up with same error.
bdefleurian
Hei
Just had someone else running into issues with numpy. And it appears that their numpy directory set in configure was too shallow. The numpy directory should look like that python3.6/site-packages/numpy/core/include/numpy/ could you check if that solves your issue.
weiji14
Nope, still the same error :/
bdefleurian
OK. I am running out of idea. The more I look at it the more it seems that it is not a ISSM issue but more of a Python issue. Have you tried to purge and reinstall your python to see if that fixes it?
weiji14
It's a clean install (on docker actually). I've even looked at the jenkins build script and as much of the source code as I can dig into, but exhausted most options already 😅
bdefleurian
Can you post your config.log I can look if there is something fishy in there. Just to confirm you are on the trunk version of ISSM not on the development branch?
weiji14
It's a bit big so here's a link to the config.log file. And yes, I should be on the trunk version.
justinquinn
Hi guys, sorry that I am just now getting the opportunity to take a look at this.
On Debian, using Python 3.7, everything compiles just fine. There is a runtime crash with ImportError: dynamic module does not define init function, which may be due to the fact that /usr/bin/python -> /usr/bin/python2 on this particular machine and --with-python-version is not actually being honored. That being said, I am currently experimenting to see if which python is the issue here.
Of note, I am working out of the development branch, so I will start diffing config files to see if there is a disconnect on our end.
In the meantime, weiji14, could you try installing 3.7 (and the corresponding numpy package) with apt and see if you can get ISSM to at least compile? This would at least narrow down the issue(s) we are experiencing.
justinquinn
After linking /usr/bin/python to /usr/bin/python3, everything compiles and runs as expected. So, I think we can assume that, after the next merge from trunk-jpl/ to trunk/, the issue is not internal. That said, I will work on and commit the following fixes:
Compilation should honor Python version supplied to option --with-python-version.
Polling Python.h with python3 should not error out on the syntax error noted above.
Please let me know if I have missed anything and I will add it to this list. As well, weiji14 let me know what if any progress you are able to make.
justinquinn
Okay, I have fixed (1) and committed to trunk-jpl/. I realized after the fact that (2) was a non-issue: what was happening was that I was compiling with flags for Python 3, but my test deck was running python, which was sym linked to python2. In all, I would advise running a copy of the development branch until we can push to the production branch (trunk/), which will happen soon (I am wrapping another, larger fix). We'll post here to the forum when that has been done.
weiji14
In the meantime, weiji14, could you try installing 3.7 (and the corresponding numpy package) with apt and see if you can get ISSM to at least compile? This would at least narrow down the issue(s) we are experiencing.
Using the apt provided numpy doesn't work on Ubuntu (and also on Debian). I've made sure to compile on a virtual environment using Python 3 (tested versions 3.6, 3.7, 3.8) so that Python 2 is not used but no luck... I think you're right that there's some symlink of python -> python2 that is messing things up.
I would advise running a copy of the development branch until we can push to the production branch (trunk/)
Don't think that I can access the dev branch [...]. So I'll just wait things to get into the main trunk 😃
justinquinn
weiji14 , you may have already done the following, but just in case, this is the methodology I used to install Python 2 and 3 with all required packages under Debian:
And, yes: if you compile for Python 3 via --with-python-version, you will have to manually run python3* or create a new sym link if running python executes version 2.*.
weiji14
Thanks for listing down all the dependencies justinquinn. I was only missing the python3-minimal dependency, but installing it still resulted in the same pyconfig.h: No such file or directory error. I've also symlinked python to python3 and compilation still fails. Might be time to try out the development branch, could you provide me with instructions to clone trunk-jpl if possible?
weiji14
Ok, I've updated to using revision 24686 (02 Apr 2020) on trunk and think I've resolved the problem after some tweaking. I've set both --with-python-dir and --with-python-numpy-dir to use $CONDA_DIR (instead of /usr) and that resolves the pyconfig.h not found error. The key was probably to be consistent (i.e. don't mix stuff between virtual environments).
There was then another error about ld not able to find python3.8m which I resolved by patching the configure file to use python3.8 instead using the below command:
sed -i 's/-lpython${PYTHON_VERSION}m/-lpython${PYTHON_VERSION}/g' $ISSM_DIR/configure
Specifically, that patches the below code block in configure:
if test "x${PYTHON_MAJOR}" == "x3"; then
PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}m"
else
PYTHONLIB="-L${PYTHON_ROOT}/lib -lpython${PYTHON_VERSION}"
Just wondering why the 'm' version is used for python 3.X and not python 2.x?
bdefleurian
To be honest I am not completely sure. The point is that when I migrated to Python3, the installation of python-dev (and hence the location of Python.h) decided that I needed the m version of this new Python. So I added those lines as I expect that this was a standard thing. So I supose that on your 3.8 your Python.h does not reside in python3.8m but in python3.8?
So short answer is that It worked for me without the m in 2.x versions and broke in 3.x. I will look into it to make a wiser test.
harronmarsh
If you write print() function in a program and someone using Python 2.x tries to run it, they will get an error. To avoid this, it is a good practice to import print function :
from __future__ import print_function
The from future import print_function ; to bring the print function from Python 3 into Python 2.x. Now your code works on both Python 2.x and Python 3.x . The future statements need to be near the top of the file because they change fundamental things about the language, and so the compiler needs to know about them from the beginning.
justinquinn
Hi, harronmarsh, I am not experiencing this issue,
So I supose that on your 3.8 your Python.h does not reside in python3.8m but in python3.8?
Ok, I think that the 'm' is deprecated just for Python 3.8 and above. See https://docs.python.org/3/whatsnew/3.8.html#build-and-c-api-changes. For Python 3.7 and below, the configure script works.
berknian
checking for python header file Python.h... configure: error: Python.h not found, locate this file and contact ISSM developers
Most of the time these are dependency-issues. Python.h is used by GNU Compiler Collection (gcc) to build applications. You need to install a package called python-dev for building Python modules, extending the Python interpreter or embedding Python in applications. You encounter Python.h: No such file or directory error while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.
Reason for this error:
You haven't properly installed the header files and static libraries for python dev.
Also, sometimes include files might not be default in the include path.
help wantedExtra attention is neededpythonRelated to Python interfaceinstallationRegarding configuration of ISSM/external packages
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
NOTE: This discussion was originally posted to the ISSM Forum, which has been decommissioned. It is reproduced here for reference. Please start a new Discussion or Issue if you wish to ask something related to this discussion.
weiji14
Hi there,
I saw in the changelog that ISSM version 4.16 has added support for Python 3, but am getting an error when compiling from the SVN source (revision 24493) that appears to be Python 2 related. I've got a Github gist to reproduce this.
The above error happens when I set the configure script's
--with-python-dir=setting to a Python 3 path, and it seems to be hardcoded to point to Python 2 header files. If I set the path to point to Python 2 on/usr, the configure script works, but a different error pops up during the make stage. Is it possible to get a fully Python 3 installation working?bdefleurian
Hei weiji
This is related to the way in which ISSM deals with its install and looks for the
Python.hpath. If you want to point to your proper Python3 install you should add the following line to yourconfigure.sh:--with-python-version=3.X \Xbeing the minor of your Python install. Be sure also that the Python 3 you installed is a dev version and includes thePython.hfileweiji14
Excellent! The configure script worked after installing
python3-dev(on an Ubuntu build) and using the two lines below:I'm now getting another error in the make stage though (the same one I saw when using Python 2). The error message is as follows:
This forum post suggests that installing
libpython3-devwill provide the missingpyconfig.hfile, but I'm pretty sure that installingpython3-devautomatically installslibpython3-dev. Is there an extra setting I need to make to fix this?bdefleurian
Hei
I am not sure about this one. Have you checked that
pyconfig.his actually here. It seems that it is the case. Could you post your configure.sh file and let me know what is your installation routine (I guess the one of the website).weiji14
Hi,
Been trying several combinations today but no luck so far. The
pyconfig.hfile is definitely there in/usr/includeso I'm not sure what's wrong. The compilation command I'm using is a bit different to the one on the website and goes like this:and I've posted two files up as a Github gist -
configureandMakefile, plus a Dockerfile with the above code. Let me know if you need any other log files and I'll upload them for you.bdefleurian
So looking at it and comparing with my install I see two possible issues. The first one is the less likely to do anything but I see that your numpy points to a 3.7 Python, that might be an issue.
For the problem at hand, could you check that you also have a
pyconfig.hin/usr/include/x86_64-linux-gnu/python3.6m/, it seems that theusr/includepyconfig.htries to grab this one.weiji14
Yes,
pyconfig.his present:I'll see if numpy is the issue, give me a few minutes.Edit: Nope, using system apt installed numpy (Python 3.6) still shows up with same error.bdefleurian
Hei
Just had someone else running into issues with numpy. And it appears that their numpy directory set in configure was too shallow. The numpy directory should look like that
python3.6/site-packages/numpy/core/include/numpy/could you check if that solves your issue.weiji14
Nope, still the same error :/
bdefleurian
OK. I am running out of idea. The more I look at it the more it seems that it is not a ISSM issue but more of a Python issue. Have you tried to purge and reinstall your python to see if that fixes it?
weiji14
It's a clean install (on docker actually). I've even looked at the jenkins build script and as much of the source code as I can dig into, but exhausted most options already 😅
bdefleurian
Can you post your
config.logI can look if there is something fishy in there. Just to confirm you are on the trunk version of ISSM not on the development branch?weiji14
It's a bit big so here's a link to the
config.logfile. And yes, I should be on the trunk version.justinquinn
Hi guys, sorry that I am just now getting the opportunity to take a look at this.
On Debian, using Python 3.7, everything compiles just fine. There is a runtime crash with
ImportError: dynamic module does not define init function, which may be due to the fact that/usr/bin/python->/usr/bin/python2on this particular machine and--with-python-versionis not actually being honored. That being said, I am currently experimenting to see if which python is the issue here.Of note, I am working out of the development branch, so I will start diffing config files to see if there is a disconnect on our end.
In the meantime, weiji14, could you try installing 3.7 (and the corresponding
numpypackage) withaptand see if you can get ISSM to at least compile? This would at least narrow down the issue(s) we are experiencing.justinquinn
After linking
/usr/bin/pythonto/usr/bin/python3, everything compiles and runs as expected. So, I think we can assume that, after the next merge fromtrunk-jpl/totrunk/, the issue is not internal. That said, I will work on and commit the following fixes:--with-python-version.Python.hwith python3 should not error out on the syntax error noted above.Please let me know if I have missed anything and I will add it to this list. As well, weiji14 let me know what if any progress you are able to make.
justinquinn
Okay, I have fixed (1) and committed to
trunk-jpl/. I realized after the fact that (2) was a non-issue: what was happening was that I was compiling with flags for Python 3, but my test deck was running python, which was sym linked to python2. In all, I would advise running a copy of the development branch until we can push to the production branch (trunk/), which will happen soon (I am wrapping another, larger fix). We'll post here to the forum when that has been done.weiji14
Using the
aptprovidednumpydoesn't work on Ubuntu (and also on Debian). I've made sure to compile on a virtual environment using Python 3 (tested versions 3.6, 3.7, 3.8) so that Python 2 is not used but no luck... I think you're right that there's some symlink ofpython->python2that is messing things up.Don't think that I can access the dev branch [...]. So I'll just wait things to get into the main trunk 😃
justinquinn
weiji14 , you may have already done the following, but just in case, this is the methodology I used to install Python 2 and 3 with all required packages under Debian:
And, yes: if you compile for Python 3 via
--with-python-version, you will have to manually runpython3*or create a new sym link if running python executes version 2.*.weiji14
Thanks for listing down all the dependencies justinquinn. I was only missing the
python3-minimaldependency, but installing it still resulted in the samepyconfig.h: No such file or directoryerror. I've also symlinkedpythontopython3and compilation still fails. Might be time to try out the development branch, could you provide me with instructions to clonetrunk-jplif possible?weiji14
Ok, I've updated to using revision 24686 (02 Apr 2020) on trunk and think I've resolved the problem after some tweaking. I've set both
--with-python-dirand--with-python-numpy-dirto use$CONDA_DIR(instead of/usr) and that resolves thepyconfig.hnot found error. The key was probably to be consistent (i.e. don't mix stuff between virtual environments).There was then another error about ld not able to find
python3.8mwhich I resolved by patching the configure file to usepython3.8instead using the below command:Specifically, that patches the below code block in configure:
Just wondering why the 'm' version is used for python 3.X and not python 2.x?
bdefleurian
To be honest I am not completely sure. The point is that when I migrated to Python3, the installation of
python-dev(and hence the location ofPython.h) decided that I needed the m version of this new Python. So I added those lines as I expect that this was a standard thing. So I supose that on your 3.8 yourPython.hdoes not reside inpython3.8mbut inpython3.8?So short answer is that It worked for me without the m in 2.x versions and broke in 3.x. I will look into it to make a wiser test.
harronmarsh
If you write
print()function in a program and someone using Python 2.x tries to run it, they will get an error. To avoid this, it is a good practice to import print function :The
from future import print_function; to bring the print function from Python 3 into Python 2.x. Now your code works on both Python 2.x and Python 3.x . The future statements need to be near the top of the file because they change fundamental things about the language, and so the compiler needs to know about them from the beginning.justinquinn
Hi, harronmarsh, I am not experiencing this issue,
weiji14
berknian
Most of the time these are dependency-issues.
Python.his used by GNU Compiler Collection (gcc) to build applications. You need to install a package calledpython-devfor building Python modules, extending the Python interpreter or embedding Python in applications. You encounterPython.h: No such file or directoryerror while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.Reason for this error:
How to solve this error:
Beta Was this translation helpful? Give feedback.
All reactions