Yousef
Dear Yousef,
If running your codes in "Spyter (qtcad)" does not resolve the issue, then I think that it would be easier to organize a live debugging session in a virtual meeting.
If you think this is necessary, please email me at fbeaudoin@nanoacademic.com to give me your availabilities.
I would be surprised if there was anything fundamentally wrong here. This is probably something simple. Some IDEs have a terminal that does not behave exactly the same as the default system terminal. As an illustration of this class of problems, in Windows, VSCode uses the normal terminal and some fiddling around is needed to make it work with PowerShell.
Best regards,
Félix