On 1 Mar 2024, at 9:11, Benjamin Davidson wrote:
> [Update] I can make this work by including the path to my virtual
> environments python installation in the shebang line:
>
> ie:
>
> #!/Users/me/dev/bbedit_test/venv/bin/python
>
> import requests
> ...
>
> But this still leaves me wondering what the setting, "Always use python
> when a virtual environment is active" is supposed to do.
Ordinarily, when using "Run" from the #! menu, BBEdit will figure out whether to use `python` or `python3` to run Python scripts which don't have a !# line.
If "Always use “python” when a virtual environment is active" is turned on, *and* a Conda virtual environment is selected in the #! menu, then BBEdit will always run `python` and will not try to run `python3`.
Ordinarily, a #! line of "#!/usr/bin/env python" is enough, provided that your external Unix environment has $PATH set up correctly.
R.
--
Rich Siegel Bare Bones Software, Inc.
<
sie...@barebones.com> <
https://www.barebones.com/>
Someday I'll look back on all this and laugh... until they sedate me.