I am running a python script from the IDE and it works well, however when calling it from the git-bash terminal the following errors showed.
./main.py: line 2: import: command not found
./main.py: line 3: import: command not found
./main.py: line 5: syntax error near unexpected token `'I am in main 1''
./main.py: line 5: `print('I am in main 1')'
In git-bash I run the chmod u+x main.py
and chmod +x main.py
lines, but it still does not work.
I am using VScode as my IDE with python3.7.9 as the interpreter, I am calling the script from the direction where it is placed in the terminal, and the script that I am testing is the following:
#!/bin/bash
import os
import sys
print('I am in main 1')
I have changed the first line for #!/bin/bash/python
and #!/bin/bash/env python3
... didn't work. I would appreciate it if someone could tell me what I miss or what I am doing wrong. I am new in git or using the terminal, any tip would be appreciated.
Thanks in advance.