1

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!

Kees
  • 451
  • 1
  • 8
  • 17
  • 1
    You mean my previous python installation is nullified by the update? (But all the folders are still there) – Kees Dec 03 '20 at 07:52

4 Answers4

3

After extreme toil and research, I finally found something that worked for me.

  1. Find the location of your Anaconda3. For me it was in ~/opt/anaconda3
  2. Open terminal and type source <location of anaconda3>/bin/activate and then
    in the next line, write conda init zsh
  3. 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/

rko
  • 194
  • 2
  • 10
1

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:

  1. Open Terminal
  2. Move the anaconda3 folder:
sudo mv /System/Volumes/Data/anaconda3 ~/
  1. 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
  1. Run the CRP tool (this will take a few minutes):
./cpr rehome ~/anaconda3/
  1. Source anacoda3
source ~/anaconda3/bin/activate 
  1. Initiate conda
conda init
  1. 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.

Lane Clark
  • 11
  • 3
0

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

Toht
  • 53
  • 6
  • Can you provide information of where the condo lines would be stored?! Can't find .bashrc in bigsur – rko Dec 30 '20 at 19:03
  • See the procedure described [here](https://medium.com/@sumitmenon/how-to-get-anaconda-to-work-with-oh-my-zsh-on-mac-os-x-7c1c7247d896) – Toht Jan 01 '21 at 10:16
  • Used the method as described in my answer above. Apparently, the method I describe creates the `.zhsrc` file with all the content from `.bash_profile` file instead of me manually copying/pasting it – rko Jan 02 '21 at 05:52
0

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.