I have found the solution to my problem and I want to share it in case someone else is in the same situation as me.
The solution I found on this page: link
1 - We have to create a "Build System" in the following way:
We go to the menu Tools / Build System / New build system ... and put the following code:
{
"cmd": ["python3", "-i", "-u", "$file"],
"file_regex": "^[ ]*File \"(...?)\", line ([0-9]*)",
"selector": "source.python"}
We save it as " python3.sublime-build "
2 - Let's go to the Sublime Text / Preferences / Browse Packages ...
menu
Inside the SublimeREPL folder we went to config / Python / and opened the file " Main.sublime-menu " in sublime text .
In this file we must modify the lines like this one in which we simply add a 3 to the word python :
"cmd": ["python3", "-u", "$file_basename"],
In my case, I have modified several lines by changing it to python3, but the one that has really fixed my problem has been:
{"command": "repl_open",
"caption": "Python - RUN current file",
"id": "repl_python_run",
"mnemonic": "R",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["python3", "-u", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
Now when I give " Python - Run current file " it works in the latest version of python and it does not give me errors that it gave me using version 2.7.10:
3.6.4 (v3.6.4: d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
hello world
I hope it is easy to understand and can help someone else.
Greetings!