conda
conda copied to clipboard
Support for global activation of an environment (similar to `pyenv global`)
Checklist
- [X] I added a descriptive title
- [X] I searched open requests and couldn't find a duplicate
What is the idea?
Would it be possible to add support for global activation of an environment?
I'm thinking of a feature that, from the user's perspective, would work the same as pyenv global
.
If the user activates an environment global_env1
globally, it isn't isolated withing the shell session where it was activated: if the user opens another shell window, the shell will start with global_env1
activated. If the user opens a GUI application from their window manager's menu, that app will start "within" global_env1
.
Why is this needed?
- Activating the same environment in every shell window or tab is an inconvenience. But this isn't really a big deal.
- Activating a desired environment for a GUI app which uses python to carry out some of its functions and was started using the window manager (in contrast to starting it from a cli), might be simply impossible. One specific example of this is Clang. When working with its source code in Visual Studio, it let's you run the tests from it. And the test runner is based on python.
What should happen?
Here's an example of how pyenv global
works:
-
I open a shell window and execute
pyenv global 3.113
Assuming, python 3.11.3 has been installed through
pyenv
earlier, this command "activates" it. So, If I now executepython --version
in the current shell window, I'll getPython 3.11.3
in response. -
I close the original shell window and open a new one. If I execute
python --version
I still get
Python 3.11.3
in response. -
I can now close the second shell window and start a GUI program from my window manager's menu. Let's say I started Visual Studio in this way. A project I would like to work on in this instance of Visual Studio executes python as a build step or to run tests. (For a specific example of this, please, take a look at Clang's Testing using Visual Studio on Windows) The python executable that VS is going to use is the version I activated globally at the step one.
Additional Context
No response