-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
make python user site-packages isolation in .local directory configurable #7707
Comments
Where do I set |
@maphew This seems to work for me:
|
What's the rationale behind not setting it for the base environment as well? |
I would vote that it should be, but somebody somewhere in one of these linked issues objected to that. |
Is this something planned for 4.6? I would vote for "all" being the default. I understand there are use cases where users want conda base (or other environments) to read from ./local, but aren't these anti-patterns? Shouldn't defaults fit the suggested use of conda as an environment+package+dependency manager? |
I wonder if the right way to fix this wouldn't be a package the adds an activation scripts to
which takes care of the issue for both R and python. The nice thing about a package would be that it can handle any interpreter that has similar issues and whose search path is configurable with environment variables -- why I guess is that case for all serious scripting languages. If there is interest in this, I could create and submit a package (a proper package would of course take care of undoing the change during |
@fgp that sounds like a really good way to do it. I recommend submitting your package to conda-forge. Are you familiar with that process? |
I think I once submitted a wrapper package for some CRAN package that one of my Bioconda packages depends on, so I'd sage vaguely familiar. I guess I'm not exactly sure what the easiest way to create a package that just creates a single file is - but probably I can include the file in the feedstock repo, and the "build script" would just copy it? Does anyone have a good suggestion for a package name? Maybe "ignore-user-directories"? |
I prefer |
Here is a pull request for a package such as I proposed conda-forge/staged-recipes#7965 I still need to test the actual package, but it principle it should work. |
Sorry guys for a dummy question, but it is hard to find out what is actually going on with site-package isolation -> lots of contradicting posts, issues, stackoverflow questions... Is now the preferable way to isolate from site-packages by installing
? Wouldn't it be better to include that by default in |
You can make conda install the isolation package into each new environment you create by default by setting Having a second option that amounts to the same thing might make it more obvious to new users how to do this, but feels a bit redundant. I can see the merit of both arguments, what do others say? |
I will give it a shot and come back here if it won't work for some reason. Thanks! |
I also see the |
#394 is now closed and locked, but the issue still persists. Loading the user-site-packages is very troublesome for normal users. |
Hi there, thank you for your contribution! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment. Thanks! |
As described in #7671 (comment)
For activated non-
base
conda environments,conda activate
will actually go ahead and set thePYTHONNOUSERSITE
environment variable, I'm suggesting you do now yourself. By default it will not set it for thebase
environment, whether the base environment is properly activated or not. This behavior will all be configurable, and there appear to be three states to what we're proposing for python interpreter isolation from~/.local
:disabled
,non-base
,all
. The default value for the configuration, as proposed, would be thenon-base
one.xref: #448
xref: #7173
The text was updated successfully, but these errors were encountered: