Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate root env and conda env #1022

Closed
Tracked by #11342
ijstokes opened this issue Dec 1, 2014 · 10 comments
Closed
Tracked by #11342

separate root env and conda env #1022

ijstokes opened this issue Dec 1, 2014 · 10 comments
Labels
locked [bot] locked due to inactivity type::feature request for a new feature or capability

Comments

@ijstokes
Copy link

ijstokes commented Dec 1, 2014

I'd like to suggest that the conda root env is separate from the env used by conda, so that any root-env updates don't impact conda's behavior.

@bkreider @tswicegood this one is for you

@ijstokes ijstokes added the type::feature request for a new feature or capability label Dec 1, 2014
@tswicegood
Copy link
Contributor

A slight tweak to the wording of this. I'd like to see conda have it's on private prefix/environment that contains conda and its immediate dependencies, then have the default environment be a separate thing that contains the packages that make up anaconda. The one thing that this does require is that you either:

  • add ~/anaconda/envs/_default to your PATH at startup instead of simply adding ~/anaconda/bin
  • or, add source activate _default

Of course, this assumes that the default name for the default environment is _default, it could really be anything.

@srossross
Copy link
Contributor

I like this idea

@tswicegood
Copy link
Contributor

I should also mention the reasoning behind this that came out of the chat.

We had a question posed on Twitter as to how to change Anaconda from Python 2 to Python 3. Given that they were using the root environment for development, actively changing that environment's Python would cause issues with other packages that are installed (anything with a shebang for python2.7 would need to be re-installed).

If the default operating mode of Conda is to use an environment to isolate the base environment with all of Anaconda linked inside that, then switching to Python3 support is simply a matter of creating a separate environment and changing a configuration value to use that environment.

@asmeurer
Copy link
Contributor

asmeurer commented Dec 1, 2014

I don't see how this would affect the question from Twitter.

@tswicegood
Copy link
Contributor

@asmeurer If you have a configurable default environment, you simply create a new environment and set it as the default.

@asmeurer
Copy link
Contributor

asmeurer commented Dec 1, 2014

But that changes the path. If all you care about is the environment that conda sees as the default you can already change that pretty easily using activate (or by setting CONDA_DEFAULT_ENV manually).

@tswicegood
Copy link
Contributor

Yes, you could and should. What I'm saying is that by having a root environment that's directly usable we're setting our user's expectations incorrectly as to how they should work with conda, thus things like changing the "root" python is something that seems harder than it is. If, however, there is no root environment, but a default one that you turn on means that changing the default environment changes behavior for you.

You are 100% correct that all of these things are possible. I'm advocating for taking those and making it the normal mode of operation where there is no a special root environment and instead simply having conda on the PATH with an internal version of Python and any required libraries. To use Anaconda, you would source activate anaconda to get the PATH and CONDA_DEFAULT_ENV setup correctly -- or put that in your ~/.bash[rc|_profile] file.

I believe this can be done in a guided way during the installation process that shows the user how to update their respective profile scripts to automatically drop them into that environment so the end result is exactly the same as what they have today, except its using real environments.

@bj0
Copy link

bj0 commented Aug 4, 2016

this would be useful for me (specifically #1023) as I am using conda primarily as python version management. I just learned about it and am using it on windows (I use https://github.com/yyuu/pyenv on linux).

pyenv solves this problem by using 'shims' (which are just shell scripts) in the path that pass commands (python, pip, etc) to pyenv and pyenv then determines which version to pass the commands to.

@kalefranz
Copy link
Contributor

see #3912. Rolling out cautiously with conda 4.4 so we can have it solid for the Anaconda 4.5 installer.

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity type::feature request for a new feature or capability
Projects
None yet
Development

No branches or pull requests

6 participants