Sublime Forum

Can't find '__main__' module in

#1

Tried to write python code in Sublime Text 3 and getting this error:

/anaconda3/bin/python: can’t find ‘main’ module in ‘’
[Finished in 0.1s with exit code 1]
[shell_cmd: python -u “”]
[dir: /private/var/folders/v2/x4smp54j0fj5qwdj4tng6y8r0000gn/T/AppTranslocation/61B8524A-00AB-4A57-A8DA-CD286815F86D/d/Sublime Text.app/Contents/MacOS]
[path: /anaconda3/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin]

0 Likes

#2

It looks like you did not save the file.

3 Likes

#3

You are right! It works!!!

0 Likes

#4

Is there anyway to run anonymous python code without saving to a temp.py first ?

0 Likes

#5

Yes, but you’d need to write a plugin that sends the view’s content over stdin instead of the default exec build system target.

Is it really so bad to create a file in the temp folder?

0 Likes