15

I have installed a fresh anaconda v4.4. I realized that python packages can be installed using both conda and pip. What is the effect of using pip to install python packages instead of conda when using anaconda? Will the pip-installed libraries cease to function? I am using python v3

EDIT: I don't think the question is a duplicate of What is the difference between pip and conda? That question explains the difference between pip and conda but does not talk about the effect of using pip when conda can be used.

darthbith
  • 18,484
  • 9
  • 60
  • 76
user3848207
  • 3,737
  • 17
  • 59
  • 104
  • this could be a possible duplicate of: https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda – matyas Aug 28 '17 at 11:14
  • Possible duplicate of [What is the difference between pip and conda?](https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda) – Uvar Aug 28 '17 at 11:55
  • Honestly, the duplicate covers a subset of this question, and at any rate is not as immediately interpretable for the specific query. I think this question (and the accepted answer below) stands for itself – information_interchange Oct 20 '18 at 20:52

1 Answers1

15

Everything might keep working if you use pip to install vs conda. However, Conda cannot manage dependencies that pip has installed - it cannot upgrade them, or remove them. More importantly, conda will install a package even if its already been installed with pip! Try this test:

conda create -n testenv python=3
conda activate testenv
pip install numpy
conda install scipy

You will see from the third command that conda will want to re-install NumPy, even though it has already been installed with pip. This can cause problems if there are C libraries whose linking is different, or something like that. In general, whenever possible, use conda to install packages into conda environments.

darthbith
  • 18,484
  • 9
  • 60
  • 76