Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between pip install and conda install in python

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what is the difference between pip install and conda install in python". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

For the most part, it makes no difference. Basically, I prefer to use pip, because the speed of domestic pip is faster than that of conda, even if domestic sources are used.

Officially speaking, pip and conda are similar in function, but there are still some differences. Conda has an official article specifically saying this: https://www.anaconda.com/blog/understanding-conda-and-pip

Pip is used to install the python package, which installs python wheel or source code packages. Compiler support is required when installing from source code, and pip does not support dependencies other than the python language.

Conda is used to install conda package, and although most of the Conda packages are python, it supports many dependencies written in non-python languages, such as mkl cuda, a package written by c C++. Then, conda installs compiled binaries, so you don't have to compile them yourself. Therefore, pip sometimes fails without a compiler in the system environment, and conda does not. This leads to a relatively large volume of conda packages, especially mkl, which is prone to hundreds of megabytes or even more than one gigabyte.

Then, conda actually has more functions than pip. Pip is almost a package installation software, and conda is an environmental management tool. Conda itself can be used to create the environment, pip can not, need to rely on virtualenv and so on. It means that you can install the python interpreter with conda, but not pip. I think this is the advantage of conda. You can easily manage many versions of python,pip with conda env.

Then there are some places that may not be easy to detect. Conda and pip handle environment dependencies differently. Generally speaking, conda is more stringent than pip. Conda checks the dependencies of all packages in the current environment, and pip may ignore previously installed packages. In doing so, conda is basically installed to guarantee work, and pip may sometimes be installed without work. However, I personally feel that this impact is not great, after all, the support of the mainstream package is quite good, rarely encounter the situation of broken. This difference also results in conda taking much longer to calculate dependencies than pip during installation, and more packages to be reinstalled (choosing to update the version of the old package).

Finally, pip packages do not exactly overlap with conda, and some packages can only be loaded through one of them.

This is the end of the content of "what is the difference between pip install and conda install in python". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report