How to get Conda and Virtualenv to work on mac OS Catalina?

前端 未结 8 1176
栀梦
栀梦 2020-12-30 05:55

I previously had Conda running smoothly on Mojave, but I\'ve found that the upgrade to Catalina moves the \"anaconda3\" folder to your Desktop > Relocated Items > Security >

相关标签:
8条回答
  • 2020-12-30 06:12

    I have the same problem, and this work for me : My solution:

    1. Copy your anaconda3 from Relocated Items folder
    2. Paste in User/YourUserName
    3. Open conda file in anaconda3/bin with the editor and edit the first line #!/anaconda3/bin/python to #!/Users/YourUserName/anaconda3/bin/python
    4. Save it and run conda file
    5. Open Terminal
    6. Run this : export PATH=''/Users/YourUserName/anaconda3/bin:$PATH"
    7. Run conda init zsh
    0 讨论(0)
  • 2020-12-30 06:22

    Technically this is reinstalling anaconda, however, I restored all my conda envs so, hopefully this is an acceptable solution!

    Here is how I got it working on Catalina as of a few minutes ago (now using z-shell): - Verified the existence of "Relocated Items" directory on my desktop and the "anaconda3" directory and its contents inside - Navigated into the envs directory under "anaconda3" and left the finder window open (see screenshot)

    THEN:

    • opened new Terminal (z-shell)
    • ran (this installed to /usr/local/anaconda3):

      brew cask install anaconda

    • after installation was successful I opened my ~/.zshrc file (for my z-shell aliases) and added the following line:

      export PATH="/usr/local/anaconda3/bin:$PATH"

    • saved my ~/.zshrc file, then reloaded with:

      source ~/.zshrc

    • to verify conda command works now, I ran:

      conda env list

    • for me, this showed a base env and that was it

    • then open Finder to the new envs location: open /usr/local/anaconda3/envs/.

    • I dragged (moved) all my old envs into the new envs folder, and then ran:

      conda env list

    And all my old envs are back! :)

    • updated my PyCharm interpreter / env paths to reflect the new locations of these envs (had to restart PyCharm after, but now it works!)
    • DONE
    0 讨论(0)
提交回复
热议问题