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.

- https://duckduckgo.com/?q=.MacOSX%2Fenvironment.plist&ia=web

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  <[email protected]>
   github.com/cngarrison   metacpan.org/author/CNG

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to