Re: Run command and Python virtual environments

2024-03-01 Thread Rich Siegel
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.
  

Someday I'll look back on all this and laugh... until they sedate me.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/1358AE2F-1C0C-4B14-90C5-8DB7385EA950%40barebones.com.


Re: Run command and Python virtual environments

2024-03-01 Thread Benjamin Davidson
[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.

Thanks!
On Thursday, February 29, 2024 at 5:22:00 PM UTC-5 Benjamin Davidson wrote:

> I'm trying to use the *#! : Run* command with Python scripts but I'm 
> unsure how to get the command to use the virtual environment that exists in 
> the workspace folder. 
>
> In the Python language settings, there is a an option to "Always use 
> python when a virtual environment is active" which sounds like what I want 
> but checking the box seems to have no effect. 
>
> Any tips on how to make this work?
>
> Thanks!
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/a0c05b77-1574-4d2f-a896-4c7e2ac57bddn%40googlegroups.com.


Run command and Python virtual environments

2024-02-29 Thread Benjamin Davidson
I'm trying to use the *#! : Run* command with Python scripts but I'm unsure 
how to get the command to use the virtual environment that exists in the 
workspace folder. 

In the Python language settings, there is a an option to "Always use python 
when a virtual environment is active" which sounds like what I want but 
checking the box seems to have no effect. 

Any tips on how to make this work?

Thanks!

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/ff1832d8-f669-4cab-9d75-c7644c0896f8n%40googlegroups.com.