Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem with python.h



  • Hi everyone
    I am new to QT creator and in compiling a program I am notified of the error python.h no such file or directory. I have QtCreator installed on Ubuntu in Virtual Machine and I also have 1.62 boost and Python 2.7 installed correctly. the python.h file is located in /usr/include/Python2.7/python.h
    Can anyone tell me what to set?

    Thanks and sorry for my English


  • Lifetime Qt Champion

    Hi and welcome to the forums

    Are you using Qt for Python/pySide2 or what is the bindings?
    Or is it a c++ project that uses python?



  • Hello
    is a console project where I have some # include of a C ++ library not made by me that uses modules written in python2.7

    #include <string>
    #include <iostream>
    #include <cmath>
    #include <opencamlib.arc.hpp>
    #include ...........
    ............

    the error is generated in the file /usr/include/boost/python/detail/wrap_python.hpp

    I also have the library file already compiled ocl.pyd
    can I use another way to call up the functions of this library?

    When I compile the library project from its source files it doesn't generate any errors so I think it's a problem with my project settings


  • Lifetime Qt Champion

    Hi
    so its this file ?
    https://www.boost.org/doc/libs/1_34_0/boost/python/detail/wrap_python.hpp

    Also, is pyd files not just for windows?
    Im not python user so would be wrong but it might not work in ubuntu.

    In any case, how are u then using the files if not via PYD ?



  • sorry you are right I explained myself wrongly the file ocl.pyd is compiled to be used in windows then I have the ocl.so version which is for Ubuntu but I don't know how to call the functions of these libraries from a QtCreator project .... .


  • Lifetime Qt Champion

    @Jonh78
    Im have never used a pythn SO file before but i wonder if you can call like normally.

    https://stackoverflow.com/questions/17081131/how-can-a-shared-library-so-call-a-function-that-is-implemented-in-its-loadin

    What inside the SO file. c function, objects or python function ?
    I assume you mean you want to call it from c++ ?



  • Yes from a C ++ project I would like to recall the functions of this library which contains both C ++ code and python modules but being brand new to QtCreator and quite new to C ++ I don't know how to do it .... so far I have always programmed in VisualBasic or C #

    Now I try to take a look at the link you posted


Log in to reply