I have a reasonable understanding of the difference between conda install
& pip install
; How pip
installs python only packages & conda
can install non-python binaries. However, there is some overlap between these two. Which leads me to ask:
What's the rule of thumb for whether to use conda
or pip
when both offer a package?
For example, TensorFlow
is available on both repositories but from the tensorflow docs:
within Anaconda, we recommend installing TensorFlow with the
pip install
command, not with theconda install
command.
But, there are many other packages that overlap, like numpy
, scipy
etc.
However, this Stackoverflow answer suggests that conda install
should be the default & pip
should only be used if a package is unavailable from conda
. Is this true even for TensorFlow
or other python-only packages?
Clearance times for normal rules new claims: are currently (April 2022) 20 weeks “end to end” (from registration to a decision being made) and 14 weeks from the AP referral to the decision.
If you get PIP you may be entitled to extra money on top of your existing benefits, a reduction in your council tax or road tax bills and discounts on travel. You'll need your PIP award letter before you can apply for this extra help. This award letter is sometimes called a PIP award notice.
Assessments can be in person, over the phone or by video call. You'll get a letter that tells you what will happen with your PIP. If your needs have changed, your PIP might be increased, reduced or stopped.
If you had a medical assessment and the DWP decide your condition has improved. If the DWP think your condition has improved, they might decide you can't get PIP anymore - or that you can't get as much PIP. If you think the DWP is wrong, check how to challenge a PIP decision.
The Tensorflow maintainers actually publish the wheels of TensorFlow on PyPI that's why it's the recommended official way. The conda
packages are created by the Anaconda staff and/or the community. That doesn't mean the conda packages are bad, it just means that the TensorFlow maintainers don't participate there (officially). Basically they are just saying: "If you have trouble installing it with pip
the TensorFlow devs will try to help you. But we don't officially support the conda
packages so if something goes wrong with the conda package you need to ask the conda-package maintainers. You've been warned."
In the more general case:
For Python-only packages you should always use conda install
. There might be exceptions, for example if there is no conda-package at all or the conda package is out-of-date (and nobody is releasing a new version of that package) and you really need that package/version.
However it's different for packages that require compilation (e.g. C-Extensions, etc.). It's different because with pip
you can install a package either:
While conda just provides the
With compiled packages you have to be careful with binary compatibility. That means that a package is compiled against specific binary interface of another library - which could depend on the version of the libraries or the compilation flags, etc.
With conda you have to take the package as-is, which means that you have to assume that the packages are binary-compatible. If they aren't it won't work (segfault or linking errors or whatever).
If you use pip
and can choose which wheel (if any) to install or compile it against the available libraries on your computer. That means it's less likely that you get a binary-incompatibility. That is (or was) a big problem if you install conda packages from different conda-channels. Because they might simply be binary-incompatible (e.g. conda-forge and the anaconda-channel have or had a few problems there).
However it should probably be decided on a case-by-case basis. I had no problems with my tensorflow
conda environment where I installed all packages from the conda-forge
channel, including tensorflow. However I have heard that several people had trouble with tensorflow in mixed conda-forge
and anaconda
channel environments. For example NumPy from the main channel and TensorFlow from the conda-forge channel might just be binary-incompatible.
My rule of thumb is:
conda install
from one and only one channel (if possible the main anaconda channel).You asked about why you cannot install packages from PyPI with conda
. I don't know the exact reasons but pip
mostly provides the package and you have to install it yourself. With conda you get an already compiled and installed package that is just "copied" without installation. That requires that the package is installed on different operating systems (Mac, Windows, Linux) and on platforms (32-bit, 64-bit), against different Python versions (2.7, 3.5, 3.6) and possibly against different NumPy versions. That means conda has to provide several packages instead of just one. That takes resources (space for the final installed packages and time for the installation) which probably aren't available or feasible. Aside from that there is probably no converter for a pypi package to a conda recipe aside from all the specifics you have to know about a package (compilation, installation) to make it work. That's just my guess though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With