How to fix SublimeText 3 Python build error?

Viewed 238

I use a Mac and haven't used Sublime Text and Python in a few months, and have come back to it for a project. But, I get an error when I try to build documents I've definitely built before, and even the simplest test document (ex. print("Hello World!")). It must be because of some Mac update, but I am not on Big Sur, I'm still on Catalina. I can't update to Big Sur to fix my problem because of my work I need certain programs that are not compatible with Big Sur yet.

I get the following error:

/Users/maxzhou/.bash_profile: line 1: export: `v6.1.1/bin': not a valid identifier
bash: /Library/Frameworks/Python.framework/Versions/2.7/bin/python: Bad CPU type in executable
[Finished in 0.0s with exit code 126]
[shell_cmd: python -u "/Users/maxzhou/Documents/Test file.py"]
[dir: /Users/maxzhou/Documents]
[path: /Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Applications/Racket:/Applications/Racket v6.1.1/bin]

I vaguely remember encountering this error when setting up Sublime Text for the first time, but now don't remember how to fix this.

1 Answers

Sorry, I met a similar error as well and my Macbook is also Catalina...

When I restart my Mac and try to run Python codes on Sublime Text 3 using "Python" system built by Sublime at the first time, everything is ok, but if I quit Sublime and then open it and run python codes then I will get some errors... e.g. if I "import bs4" then I will get an error "there is no module called bs4" but I do install this module by pip install (as well as pip3 because I install two kinds of Python in my Mac, one is Anaconda while another is Python 3.8)...

I don't know what happens but I think this might be kind of bug on Mac or Sublime maybe...

Related