On 25 May 2018, at 1:43, 'Matthew Miller' via BBEdit Talk wrote:
I'm fairly new to BBEDIT, and have recently installed two versions of python on my Mac mini. The original version of python installed was 2.7, however, I also wanted to work with python 3.0 for different projects. Now my previous code that worked with Python 2.7 no longer works after I installed a separate Python version 3.7. Any recommendations on how to fix this issue? My goal would be to set a default python version through BBEDIT that way I can bounce between the two python versions.
Set your PATH so the 3.7 version is found first. I use .MacOSX/environment.plist for that; there may be other/better ways to do that now.
Then set the script shebang to /usr/bin/env python.
You could set the shebang for each script to path of the 3.7 binary, but you'd be stuck with that until you modified the script shebang again. Using PATH and env is more flexible; just change the PATH and scripts use the new version.
-cng
PS. This method is not specific to python. It works for all scripts using a shebang.
--
Charlie Garrison garr...@zeta.org.au
github.com/cngarrison metacpan.org/author/CNG