You are not logged in.
Hi
I have a computer which I've installed python-conda in followed by "conda init zsh" etc - the details are in this single post: https://bbs.archlinux.org/viewtopic.php … 7#p2040587
Now I'm on another computer and attempted to do the same. So I installed "python-conda" using yay -S. I then created a conda virtual environment with "conda create --name=pyoccenv python=3.9". After this I wanted to activate the enviroment, but immediately after that everything is screwed anod nothing works at all:
❯ conda activate pyoccenv
❯ uname
zsh: correct 'uname' to '_uname' [nyae]? n
grml_maintain_name:2: command not found: uname
zsh: command not found: uname
❯ ls
grml_maintain_name:2: command not found: uname
zsh: command not found: ls
❯ whoami
grml_maintain_name:2: command not found: uname
zsh: command not found: whoamiI use zsh - everything has worked on another pc... So it's frustrating - as you see, absolutely nothing works after activating the virtual environment (and yes, "uname" works and prints "Linux" outside or before activating the conda-environment)... It had been a while since I've updated so I did a full update "yay -Suyy" followed by a reboot. And now I'm back - and the problem is still there... I also tried upgrading extra/python-setuptools to 1:61.3.1-1 instead of 1:60.10.0-1 - but as that didn't make a difference I went back to 1:60.10.0-1 (from the extra-repo, not "testing). It's really annoying because it has worked on another pc I must however add, that it works with "bash" - so I'm not completely lost, just don't know what I can do to fix or investigate this (I tried "yay -S zsh" to re-install zsh and hopefully "reset" it, but... I don't know).
Does anyone have a clue as to what is going on and/or how to solve this?
I would be very grateful if I can get this solved because otherwise I might have to do some drastically like install everything in a virtual machine or docker container etc, but I reaaaaly hope I can avoid that, thanks!
Last edited by newsboost (2022-06-14 15:59:28)
Offline
if you want to use zsh, you must correct yout PATH variable
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
and why are just using the yay aur helper?
So If I read correctly your issue is resolved simply by using bash?
I tried "yay -S zsh" to re-install zsh and hopefully "reset" it, but... I don't know)
simply removing the package won't resolve the issue is most cases.
Offline
if you want to use zsh, you must correct yout PATH variable
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATHand why are just using the yay aur helper?
Thanks, I'm on another computer now, but I'll get back later today and update this. Still, even if adding the path once again after starting up the virtual environment, it's really strange that it doesn't work. Remember that the PATH was correct and fully working, just before entering the conda virtual environment. I'll let you know later today if this fixes it, thanks!
So If I read correctly your issue is resolved simply by using bash?
I tried "yay -S zsh" to re-install zsh and hopefully "reset" it, but... I don't know)
simply removing the package won't resolve the issue is most cases.
I don't see it as "resolved simply using bash", because I prefer to use zsh - and obviously the problem is also not solved by removing zsh - because I want to use zsh. But the link you showed reveals to me that maybe it's oh-my-zsh that screws things up. Even if what you wrote about setting the PATH-environment is correct, then of course it's a work-around to the problem and I'll also be (very) happy about that. But the problem is not really solved as it should. It's also difficult for me to e.g. create a ticket upstream when I have no clue about the cause of this problem and I know I cannot replicate this problem on another pc as I've done exactly the same as on another pc, where things are working...
I'll return with more details when I'm back in front of the proper computer, thanks!
Offline
it's oh-my-zsh that screws things up
^ This.
Search the boards, that framework has been the root cause of *many* threads. It's a buggy pile of shite.
Jin, Jîyan, Azadî
Offline
Do you actually need to use conda? I also use zsh with omz and I find that activating plain venvs works but deactivate messes up the prompt. I prefer using plain python to conda, and I've had good luck with pyenv. pyenv switches python envs based on an environment variable and wrapper scripts, so it seems to not break your shell both with activating and deactivating.
Offline
if you want to use zsh, you must correct yout PATH variable
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
Ok, now I'm back at the computer with the problem. So my original path:
/usr/bin:............:/usr/lib/ccache/bin:/opt/google-cloud-sdk/bin:/usr/condabin:/usr/local/bin:/usr/local/sbin:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/home/user/.dotnet/tools:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/bin:/home/user/.local/binAfter running "conda activate pyoccenv" in zsh:
/home/user/.conda/envs/pyoccenv/bin:............:/usr/lib/ccache/bin:/opt/google-cloud-sdk/bin:/usr/condabin:/usr/local/bin:/usr/local/sbin:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/home/user/.dotnet/tools:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/bin:/home/user/.local/binI have simplified it a bit by removing a lot of intel oneapi stuff, denoted by "....". As far as I can see, "conda activate" completed removed the original initial "/usr/bin:", which is *COMPLETELY* insane... So I tried:
export PATH=$PATH:/usr/binWhich actually does work! But it's completely insane that the "conda activate"-script does not handle this properly. About "oh-my-zhs": I'll reply to that also, in another post shortly... But it's nice that I now at least have some kind "of fix" - still not an explanation, but it's luckily a simply working fix, thanks a lot for this excellent suggestion!
Offline
newsboost wrote:it's oh-my-zsh that screws things up
^ This.
Search the boards, that framework has been the root cause of *many* threads. It's a buggy pile of shite.
I now tried to remove the package: "oh-my-zsh-git r6206.29b5c182b-1". Then I tried: "conda activate pyoccenv". I then claimed that my shell was not initialized, so I ran "conda init zsh" followed by: "conda activate pyoccenv". And we're back at the situation from the original post, where I need to
export PATH=$PATH:/usr/binin order to make things work... So I don't think we can blame oh-my-zsh, this time as the problem persists on this pc, even when oh-my-zsh has been uninstalled... But thanks anyways, I had to test if this made a difference... As the fix with appending the missing /usr/bin to PATH is so easy, it's perhaps not that important to understand the problem... But it's weird the "conda"-people seem to have made such a mistake here, I don't get it... Thanks for the suggestion though, it was worth trying out!
Offline
Do you actually need to use conda? I also use zsh with omz and I find that activating plain venvs works but deactivate messes up the prompt. I prefer using plain python to conda, and I've had good luck with pyenv. pyenv switches python envs based on an environment variable and wrapper scripts, so it seems to not break your shell both with activating and deactivating.
I think I do need conda in this case, at least it's the safest choice because I'm testing a framework which the author recommends using conda for. I've found that conda has a lot of package repositories which might be slightly different from what we get when we use plain Arch linux python - and in this case it matters and when I use conda, it makes the difference whether or not I can e.g. plot some examples. So yes, unfortunately, in this case I think I need conda and the repositories built around that, which the author of a package has recommended to use... Well, it might be that I could make it work with plain venv or pyenv - but now conda is working "just" by adding: "export PATH=$PATH:/usr/bin" - but it's strange it's really necessary and that /usr/bin has been removed from the path, after activating conda... Sounds like a bug to me, hmm.... I'm currently thinking if I should make a ticket at https://github.com/ContinuumIO/anaconda-issues/issues (if that's even the proper place, I'm not that used to conda yet), but it would be best if I can figure out a bit more about the root cause of this problem... I'll maybe try some more testing tomorrow, otherwise at least I have a working work-around now (appending /usr/bin to PATH), thanks!
Offline
hmmm.... Just trying to understand: So the "conda init zsh" adds this code to the end of my ~/.zshrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/etc/profile.d/conda.sh" ]; then
. "/usr/etc/profile.d/conda.sh"
else
export PATH="/usr/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<Since I do have the "/usr/etc/profile.d/conda.sh" file, it'll source that file instead of doing 'export PATH="/usr/bin:$PATH"'. I've search a bit more and will consider opening a ticket at https://github.com/conda/conda/issues/ which I think is the proper place... But would nice to be able to understand why this problem exists on one of my pc's, but not on the other... It really confuses me that the "/usr/etc/profile.d/conda.sh"-script has a lot of weird backslashing going on e.g:
__conda_reactivate() {
\local ask_conda
ask_conda="$(PS1="${PS1:-}" __conda_exe shell.posix reactivate)" || \return
\eval "$ask_conda"
__conda_hashr
}Normally I would NOT expect a backslash in front of "local" nor in front of "eval", I don't understand why it's even there - it even looks wrong, but there's probably a reason I don't understand... Anyway, if anyone has ideas as to what I could test for maybe understanding why this problem appears on this pc (but not on another similar also running Arch Linux), please let me know and I might test/experiment a bit more tomorrow before deciding what to do.
Offline