I just got an m1 Mac and installed anaconda using home-brew:
brew install anaconda
It looked like it worked great, except that when I actually go to use anaconda and type "conda" I get the dreaded "conda command not found" error. How do I fix this?
Based on the answer given by #Peter here as well as the anaconda documentation, adding to path is no longer recommended. The answers here also did not solve the problem.
Figured it out! Challenge lay in the home-brew path. To run the conda init zsh command, detailed by #Sebastian in the answer here, I had to specify home-brew, as well as back up a couple directories. The command that actually got it done in terminal was:
~/../../opt/homebrew/anaconda3/bin/conda init zsh
Happy home-brew anaconda-ing on your new m1s everyone.
Related
I did an brew upgrade and afterwards keep getting an bad address error.
Tried to uninstall/reinstall everything, but cant figure out what is the problem.
bash: /home/linuxbrew/.linuxbrew/bin/go: Bad address
Im new to terminal and linux, so all advice is welcome.
I tried brew doctor. It says "No developer tools installed." and after i 'brew install gcc' it says gcc is already installed and up-to-date.
Use the official Go installation:
Go: Download and install
For full support, avoid OS package managers, Homebrew, and so forth.
First, remove any previous installations by other methods, for example, Homebrew.
Little late, but this post was a suggestion for me when I ran into a similar issue with Go and Brew.
When Brew updates the version of Go (1.19.3 -> 1.19.5 in my case) that it is providing, for some reason it does not correctly update the GOROOT environment varaible. Correcting the value of the variable fixed the issue for me.
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/<go_version>/libexec
# example
export GOROOT=/home/linuxbrew/.linuxbrew/Cellar/go/1.19.5/libexec
I have anaconda installed in my computer and after installing Oh my zsh. Conda and python etc. command is not found.
zsh: command not found: conda
How can I fix this? It seems that the solutions I can find on the internet is a bit outdated.
It depends on how you installed it. You'll need to check your PATH variable, and compare against what you had in the original .zshrc file. You can then add it back like so
PATH="<PATH_TO_DIR_CONTAINING_CONDA:$PATH"
Sorry if this is a stupid question. I use python/jupyter a lot and it's stopped working after updating from Mac OS High Sierra to Big Sur. I'm trying to figure out why, but I'm not great with command line stuff.
The problem. When I try python3, pip -v, conda, etc. it says "command not found". python still seems to run, but it's 2.7 and I know I had 3 (I probably had a few versions from untidy file systems). I want to avoid reinstalling all my packages and things again, because I know it's still there and I've done this a few times already.
Some clues. I know this OS upgrade moves me from bash to zsh. I've tried just switching back to bash with chsh -s /bin/zsh but it still says command not found. I also noticed the OS update creates a Mac HD (below System/Volumes) within my Mac HD, and in that second one seems to be still all my python3/conda/pip/etc. folders. Not sure if/how this matters. Or if this is just a path issue.
I just want to get Jupyter running again on my Mac without reinstalling all my myriad packages from square one. Any help appreciated!
After extreme toil and research, I finally found something that worked for me.
Find the location of your Anaconda3. For me it was in ~/opt/anaconda3
Open terminal and type source <location of anaconda3>/bin/activate and then in the next line, write conda init zsh
Close your terminal and open it again. You should see a prefix (base) when you open it again.
All in all, for me it was
rko3 ~ % source opt/anaconda3/bin/activate
rko3 ~ % conda init zsh
Let me know if this works for you!
PS. You may be tempted to change $PATH variables. Anaconda advises against that. Use this reference instead that suggests the above. https://docs.anaconda.com/anaconda/install/mac-os/
I've just resolved this exact issue on my machine after upgrading to Big Sur from Mojave.
The issue: MacOS, as of Catalina, no longer lets you use the system root folder. Anaconda used to install in this folder. After upgrading from Mojave to Big Sur, you'll likely find your anaconda3 folder, including all your environments and packages, located here: /System/Volumes/Data/anaconda3.
Here is what to do to fix it:
Open Terminal
Move the anaconda3 folder:
sudo mv /System/Volumes/Data/anaconda3 ~/
Download Anaconda's Conda Prefix Replacement (crp) tool:
curl -L https://repo.anaconda.com/pkgs/misc/cpr-exec/cpr-0.1.1-osx-64.exe -o cpr && chmod +x cpr
Run the CRP tool (this will take a few minutes):
./cpr rehome ~/anaconda3/
Source anacoda3
source ~/anaconda3/bin/activate
Initiate conda
conda init
Quit Terminal and open it again.
Edit: Someone didn't like that I ended this answer with "That's it! Enjoy". In the scenario described, the steps above were indeed all it took to resolve the issue. If you're experiencing the same issue, I hope this helps resolve it, so you can get back to enjoying your updated OS.
Seems like your environement is not activated. Zsh sources ~/.zshrc while bash sources ~/.bashrc.
You can copy lines related to conda from your ~/.bashrc to your ~/.zshrc.
AF
Open the Anaconda navigator and click on the Environments section. There you will see the base (root) and a green triangle next to it.
Click on the triangle and select Open Terminal.
Now, in the terminal you will be already in the necessary directory for anaconda and you can then update any packages.
For example, just by writing conda update --all you can update all packages available for updates.
So I recently installed anaconda on my macOS and now that I'm trying to see if anaconda is working, I see that its not working... I typed
conda list
into terminal and it gives me this message:
:-bash: conda: command not found:
Im not sure exactly what to do, Thanks for the help!
Where's your anaconda installed? can you go to that folder and try it? you should see something like this:
packages in environment at /Users/.../anaconda:
if that doesn't work, can you try the GUI (Anaconda navigator) and see if it loads?
I'm using pyenv-virtualenv on Ubuntu 16.04 LTS.
While I was installing imblearn package for my virtualenv using Python 3.5, I realized it was being installed on system environment which uses Python 2.7. I checked with pyenv version but it clearly returned that I was on my virtualenv.
I opened a Python shell and tried to import imblearn and got ImportError: No module named 'imblearn'.
When I checked with pip list, it clearly stated that imblearn was installed. But every other packages that have been installed were missing, hence telling that the list was of system environment.
I've tried making a new environment and checked but the list is still of system and installation goes to system as well.
My pip is stuck with system.
I have never experienced this before and have no idea how to fix this.
Below is my .bashrc setting:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Just the way it tells me to set.
I've been using it fine until yesterday which I found out this was happening.
I suspect it has something to do with pyenv global command which I used while I was telling my partner how to use pyenv-virtualenv yesterday.
Still, I have never had a problem with that command before.
Please help.
Update
For some reason, source ~/.bashrc put everything back to normal. (I don't know why I typed this command. I just did it.)
But I'd still like to know how this happened and why it is fixed when I changed nothing in my .bashrc file and when even re-opening terminal or rebooting didn't fix things.
I still don't know how this was solved, and assume that this won't happen in later version pyenv-virtualenv.
It's a year old post, but I guess I could post what helped me back then so that others won't try to solve my long ago problem for me.
Thanks for letting me know.
source ~/.bashrc