0

This might be an issue with sublime text, in which case I need to open an issue. However, I thought I'd ask here first.

First of all, I have already tried all the answers mentioned here: Python 3.4 on Sublime Text 3

I am running on the latest stable version od Pop!_OS, with Sublime Text installed with flatpak via the pop shop.

When I try to run this file with the answer given above, I get this:

CODE:

import sys
print("Sublime is using: ", sys.version)

OUTPUT:

Sublime is using:  3.7.4 (default, Nov 10 2011, 15:00:00) 
[GCC 9.3.0]

This doesn't seem all that bad, but I don't have python3.7 installed at all (at least not in the usual /usr/bin location). When I run /usr/bin/env python3, or just python3, I get a prompt using python3.8. To remove any other possible errors, I changed the sublime build to be

{
    "shell_cmd": "/usr/bin/env python3.8 ${file}",
    "selector": "source.python",
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "working_dir": "${file_path}",
}

But this returns

/usr/bin/env: ‘python3.8’: No such file or directory
[Finished in 0.0s with exit code 127]
[shell_cmd: /usr/bin/env python3.8 /home/USERNAME/Documents/MinecraftCloneButCooler/main.py]
[dir: /home/USERNAME/Documents/MinecraftCloneButCooler]
[path: /app/utils/bin:/app/sublime_merge/bin:/app/bin:/usr/bin]

All of this I really wouldn't mind, except that I really need some pip libraries installed, and like I said earlier, I can't seem to find any installation of python3.7 installed anywhere. Any help would be greatly appreciated, thanks!

--EDITS:--

I tried using "shell_cmd": "python3 -u \"$file\"", but that actually caused a new error. When I use that shell_cmd Sublime actually says that it can't find a build system (yes I have verified that I am using the right one in tools > build system)

gaetgu
  • 134
  • 1
  • 11
  • Does this answer your question? [Python 3.4 on Sublime Text 3](https://stackoverflow.com/questions/23257984/python-3-4-on-sublime-text-3) – Arya McCarthy Dec 22 '20 at 03:54
  • No, sorry but that didn't work. – gaetgu Dec 22 '20 at 05:08
  • In what way did it not work? Did you get an error message? The built in build system for Python executes `python`; seems like on your system that's Python 3.7 (Sublime does not come with a user version of Python pre-installed). You can see where that version is coming from by saying `which python` in a terminal. What is the result of `which python3` as well; anything? – OdatNurd Dec 22 '20 at 06:28
  • `which python3` returns `/usr/bin/python3`. I can't give the error message right now, but I will be sure to edit that into my answer tomorrow. – gaetgu Dec 22 '20 at 06:30
  • In the interim, I would try using a `shell_cmd` like `"shell_cmd": "python3 -u \"$file\""` and see if that finds and runs the version that you want. – OdatNurd Dec 22 '20 at 15:20

0 Answers0