Did you clean the project (clean, re-run cmake) after checking the version without Python bindings?
If you add Anaconda3 to your Path environment variable now, does SAMSON crash when you run in Debug?
I suggest adding some variable defining whether you compile the project with Python bindings or without such that it won't be compiled with Python bindings in the Debug mode at all, e.g. in the CMakeLists.txt of your Element (see the PyBindTutorial sample):
IF( NOT DEBUG )
FIND_PACKAGE( PythonInterp ${PYTHON_VERSION} REQUIRED )
IF ( PYTHONINTERP_FOUND )
SET(CREATE_PYTHON_BINDINGS TRUE)
ENDIF ( PYTHONINTERP_FOUND )
ENDIF()
IF ( CREATE_PYTHON_BINDINGS )
add_definitions(-DCREATE_PYTHON_BINDINGS)
ELSE ( CREATE_PYTHON_BINDINGS )
SET (PYTHON_LIBRARY "")
ENDIF ( CREATE_PYTHON_BINDINGS )
TARGET_LINK_LIBRARIES ( ${OUTPUT_NAME}
${QT_LIBRARIES}
${PYTHON_LIBRARY}
${OPENGL_LIBRARY}
${SAMSON_SDK_LIBRARIES} )
And then use this CREATE_PYTHON_BINDINGS
variable in your code like it is done in the PyBindTutorial sample, e.g.:
#ifdef CREATE_PYTHON_BINDINGS
#include "pybind11/pybind11.h"
#endif
You can test whether you have the same problem with the PyBindTutorial sample when you compile it in the Release mode, and then launch SAMSON in the Debug mode.