I use miniconda as my default python installation. What is the current (2019) wisdom regarding when to install something with conda vs. pip?
My usual behavior is to
Note: The following recommendations are now part of the official documentation.
"What is the current (2019) wisdom regarding when to install something with
condavs.pip?"
Anaconda Inc's Jonathan Helmus sums this up quite nicely in the post "Using Pip in a Conda Environment." Here's an excerpt from the final best practices recommendation:
Best Practices Checklist
Use
piponly afterconda
- install as many requirements as possible with
conda, then usepip- pip should be run with
--upgrade-strategy "only-if-needed"(the default)- Do not use
pipwith the--userargument, avoid all “users” installsUse Conda environments for isolation
- create a Conda environment to isolate any changes
pipmakes- environments take up little space thanks to hard links
- care should be taken to avoid running
pipin the root [base] environmentRecreate the environment if changes are needed
- once
piphas been usedcondawill be unaware of the changes- to install additional Conda packages it is best to recreate the environment
Store
condaandpiprequirements in text files
- package requirements can be passed to
condavia the--fileargumentpipaccepts a list of Python packages with-ror--requirementsconda envwill export or create environments based on a file withcondaandpiprequirements