-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
activate/deactivate changes to HOST environment variable #7031
Comments
@mingwandroid: Could be that this is due to name collisions of the |
If we don't get #6338 anytime soon, we probably could at least wrap the lists of |
Yeah it will be that. Hmm. Maybe I should just remove it or rename it in binutils? No one really installs just binutils on its own, well maybe some assembly only project would! |
I ran into the same problem. I experience this since conda is outputting all the compiler INFO and DEBUG upon activating an env. One of the lines it outputs is Maybe in z-shell this overrides the HOST variable. But how can it be that this output is even interpreted? |
Same problem after I updated Jupyter Notebook? cathy@MacBookPro:~ $ source activate py3
INFO: activate-gfortran_osx-64.sh made the following environmental changes:
...
(py3) cathy@x86_64-apple-darwin13:~ $ source deactivate
INFO: deactivate_clangxx_osx-64.sh made the following environmental changes:
...
cathy@x86_64-apple-darwin13:~ $ echo $HOST
x86_64-apple-darwin13.4.0 And a window pops up every time I activate an environment, showing
though fixed it by installing Java for OS X 2017-001 |
R needs Java, sorry. |
@mingwandroid We should probably add a section to the Conda Troubleshooting stuff about that Java popup. Where it comes from and how to fix it. I've seen people just live with it, and it really is super annoying. |
I'll think about moving it to rJava, but this Java stuff is baked into the core for some reason. :-( |
I also ran into the same problem using anaconda together with zsh. Is the |
It's used by our compilers. Depending on how you use those, changing it
might break those. If you don't use the compilers, it's fine to replace.
…On Fri, Mar 8, 2019 at 3:45 AM sgasse ***@***.***> wrote:
I also ran into the same problem using anaconda together with zsh. Is the
HOST variable used for anything by conda? Or can I just reset it with
HOST=$(hostname) in my startup script?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7031 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AACV-euFFiFP3PMOBOQlb96-_3tXcT9Yks5vUjEcgaJpZM4SqWK2>
.
|
@msarahan good to know, though I would argue that's not a great thing to do on several levels. Hostnames are not supposed to have these semantics. I set HOST to "" which I didn't expect to have any consequences and I only came upon your command by accident. I would really love for you to use literally anything else. Maybe I got my linux knowledge wrong but I thought |
@msarahan why would compilers need the |
Oh, I see now - you're just keeping track of the type of OS & architecture, and using a variable called The reason it changes the prompt is that many people have Perhaps you could change Conda to use something like |
I am having a similar issue with my miniconda environments. The java JDK was solved as @ladychili indicated. I notice that the |
I encountered the same problem with zsh and conda. I suggest to set a variable called something like |
Yes, the answer is clear. The work required is not negligible, as detailed in AnacondaRecipes/aggregate#151 We're sorry for the inconvenience. We'll fix this as time allows. |
I've had the same issue as others above and believe I've (at least temporarily) resolved it, by commenting out these lines of code in my ~/.zshrc
|
Recently I've encountered the same issue, the reason is exactly what others above said, which is because conda changed environment variable
HOST=$(hostname)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon host anaconda dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time)
# source oh-my-zsh config
source $ZSH/oh-my-zsh.sh
It may not be a solution once for all but at least right now I can check which node I'm using in the cluster |
Thanks! Very helpful for now. |
Temporary workaround: Add the following line at the end of
This will replace the placeholder variable |
Another possible workaround, to be placed in
|
It works! Thanks! |
@msarahan Can't you guys set it locally for only conda, like setting somewhere in script. As i think only conda needs this. I ran into problem while working with c++, vuejs (for web development) and etc. It could be better if conda temporarily sets it for that compiling stuff you are talking about |
As with @tbhaxor, this behavior with Conda is causing complications when I'm trying to fire up a local development server with vuejs (for a simple frontend app to a Python data processing pipeline)- conda's HOST environment variable is overriding what should be simply 'localhost' or '127.0.0.1,' resulting in a vuejs development server that is supposedly trying to run at the nonsense address http://x86_64-apple-darwin13.4.0 (as I'm on OSX High Sierra). My solution has been to use conda's functionality for setting environment variables when activating any or a particular environment, which I think is a relatively new feature. For setting it for one particular environment, one can use:
|
Can still reproduce. |
This problem still exists with Conda v 4.9.1. It is not really reasonable to permanently overwrite the OS $HOST variable without resetting it especially considering the popularity of zsh. |
Problem still remains with Conda v. 4.9.2 and a conda update --all (with bash or zsh) annoying error for every conda comment: ERROR: This cross-compiler package contains no program /user/anaconda3/bin/x86_64-apple-darwin13.4.0-ar |
I know it's not a solution but maybe a work around is using mamba? |
This problem still persists (I can live with ZSH showing wrong thing, but I also have some scripts that rely on
|
I was able to remove the "changed" hostname due to install of packages by first conda list --revisions to find the "the package that causes the hostname to change." I looked for the complier and copied the name of it. Then conda remove "name of complier" as show below.
I had to do this because I install the package system wide at the conda base. Now I've reinstalled the package within its own conda environment. So when I go back to conda base my host name changes back to default.
|
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! |
This bug is still outstanding on at least conda 4.12. Another workaround is to add a script to
|
Still true in February 2023, I cannot run something as basic as Create React App locally, without starting it with |
anaconda often messes up $HOST, altered to 'x86_64-conda-linux-gnu', etc. which is displayed in the prompt (see conda/conda#7031). One workaround is to override and correct $HOST on the startup of an interactive zsh shell.
Removing an activate.d script which alters
|
@bartekrey yeah, I think I'm going to un-watch this ticket - it had a patch sit dormant for a couple years until it got too stale to apply. I don't use |
@kenodegard Are there any news on this? |
The previous workaround of setting $HOST in an interactive shell did not work with tmux, because the tmux server runs in a non-interactive shell and have the wrong $HOST variable set by conda. Fix the $HOST environment variable in ~/.zshenv. Workaround for conda/conda#7031
I've updated my workaround: put the following in ~/.zshenv or ~/.bash_profile (not in zshrc/bashrc; it needs to be applied for non-interactive shells as well)
BTW I feel it's a bummer that this bug hasn't been fixed yet. |
I'm submitting a...
Current Behavior
When activating an environment the HOST environment variable is set to "x86_64-conda_cos6-linux-gnu". After deactivating it isn't removed and still shows as host in my zshell.
Steps to Reproduce
HOST environment variable is unset before "source activate" sets it.
Expected Behavior
Should change the environment variable HOST back to its previous configuration.
Environment Information
`conda info`
`conda config --show-sources`
`conda list --show-channel-urls`
The text was updated successfully, but these errors were encountered: