OS X - Deciding between anaconda and homebrew Python environments

前端 未结 2 498
囚心锁ツ
囚心锁ツ 2020-12-22 19:47

I use Python extensively on my Mac OS X, for both numerical applications and web development (roughly equally). I checked the number of Python installations I had on my lapt

相关标签:
2条回答
  • 2020-12-22 20:08

    Workflow that I've found the best:

    • Use conda for virtual environment management. Never use / install into system python.

    • Use pip to install into the active virtual environment, just like normal.

    • Use conda packages only for hard to install software, such as Qt.

    Automation / extras

    • Use autoenv or direnv and automatically activate virtual environments when you enter a directory by putting the conda command inside the .env or .envsrc file.
    0 讨论(0)
  • 2020-12-22 20:17

    I use Homebrew Python for all my projects (data science, some web dev).

    Conda is nothing fancy, you can have the same packages by hand with a combination of pip and Homebrew science. Actually, it is even better because you have more control on what you install.

    You can use your virtualenvs only when you do web development. For the numerical applications you will probably want to have the latest versions of your packages at all times.

    If you want to update all your packages at once with pip, you can use this command:

    sudo -H pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 sudo -H pip install -U
    
    0 讨论(0)
提交回复
热议问题