Oct-04-2023, 10:14 AM
The following serves as the foundation of my code; however, I encounter an error: "ImportError: No module named gdb". How can I resolve this issue? Google Bard AI has suggested using the command
Python version: 3.12.0
pip install gdb
in the terminal, but I would like the GDB Python API to be installed permanently within my project. I want it to reside in the project's third-party or binary folder, similar to how the python312.dll can be placed in the binary folder. This way, it remains unaffected even if I reinstall the operating system. I'm building a game engine, and I want to make it easy for users to get started without requiring them to install the GDB Python API. I want to replicate the experience of using VSCode, where users can install GCC without needing to install GDB Python API.Python version: 3.12.0
// https://stackoverflow.com/questions/17028576/using-python-3-3-in-c-python33-d-lib-not-found #ifdef _DEBUG #undef _DEBUG #include <Python.h> #define _DEBUG #else #include <Python.h> #endif int main() { Py_Initialize(); PyRun_SimpleString(std::string(R"_( import gdb # ImportError: No module named gdb print("Hello, World!") )_").substr(1).c_str()); Py_Finalize(); return 0; }