Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I replace my Homebrew based Python configuration with Conda

I currently have a rather complex Python configuration that has evolved over the years, and I'd like to clean it up and "modernize" it.

The existing configuration has a the default macOS Python, and Homebrew's Python 3 and Python 2 all existing side-by-side, along with their associated Pips. I also have some python command line tools that these Pythons or their associated installed packages have created, and which I use more or less frequently.

What I'd like to do is:

  • Leave macOS Python untouched
  • Eliminate all Homebrew Python's
  • Remove non-macOS Python 2 entirely
  • Switch to Conda Python as my Python 3
  • Have access to mkvirtualenv (as an alternative to creating environments) with virtualenvwrapper
  • Have access to Jupyter

I'm not sure how to do this without creating problems, and want to confirm that the obvious thing is the safe thing:

  1. use Homebrew to uninstall its Pythons,
  2. install Conada, and then
  3. use (Conda's) pip to install mkvirtualenv, virtualenvwrapper, and Jupyter (and any other tools I subsequently need)

Is that the correct procedure? Is so are there particular forms of the commands I should use or options I should chose for them?

like image 646
orome Avatar asked Aug 12 '26 10:08

orome


1 Answers

First, install anaconda or miniconda. The installation is non-destructive and does not conflict with your other Python installations. Check that it works before you consider removing homebrew installed Pythons.

The conda command is used both as a package manager and as an environment manager. You cannot avoid creating conda environments: the default installation is already part of an environment named base. I'm not sure why you would want to, either.

You can use pip to install any package you choose into a conda environment, but since you can use conda install for any package available on any conda channel (e.g. 'defaults', 'conda-forge'), using pip often is redundant.

You could use non-conda virtual environments, but again: why? conda create -n foo python=x.x jupyter #etc and then conda activate foo is all you need to get one up and running.

like image 51
ralex Avatar answered Aug 14 '26 23:08

ralex