How do I use Conda in on Homebrew Python system?

前端 未结 2 1379
南旧
南旧 2021-02-05 15:24

I\'m using Homebrew as my package general manager, and am using its Python and pip for software development, along with virtualenvs. For various reasons, I\'d like to continue w

2条回答
  •  眼角桃花
    2021-02-05 15:51

    I may be wrong but it sounds like the op is trying to figure out how to make a virtual environment for anaconda without overriding all their existing python stuff. At least that is what I was trying to do which led me here. I managed to find a rather inelegant solution that you can use if you really must have anaconda in its own env:

    As devssh says, you can do a brew cask install anaconda but dont add the directory to your path, or it will override your python 2.7 and cause much sadness. Instead create a virtual environment like such (Im using virtual environment wrapper):

    mkvirtualenv -p /usr/local/anaconda3/bin/python anaconda_env
    

    now move all the stuff from anaconda bin into your virtualenv bin:

    cp /usr/local/anaconda3/bin/* /Users//.virtualenvs/anaconda_env/bin/
    

    This last is necessary because the anaconda dependencies were not installed with the environments pip so it doesnt know where to look for them.

提交回复
热议问题