I have been doing machine-learning for quite a long time using matlab and have recently switched to python and for installing certain packages used its package manager pip and successfully installed many packages. A few days ago I started using conda and all my previously installed packages are getting overridden.
I really want to know the difference between pip and conda and what happens if I use pip to install packages instead of conda?
It's fully recommended to use pip inside of conda. It's better to install using conda, but for any packages that don't have a conda build, it's perfectly acceptable to use pip.
Once pip is used to install packages and software into a conda environment, conda will be “unaware” of these changes and may make modifications that would break the environment and result in errors.
The fundamental difference between pip and Conda packaging is what they put in packages. Pip packages are Python libraries like NumPy or matplotlib . Conda packages include Python libraries (NumPy or matplotlib ), C libraries ( libjpeg ), and executables (like C compilers, and even the Python interpreter itself).
You can install pip in the current conda environment with the command conda install pip , as discussed in Using pip in an environment. If there are instances of pip installed both inside and outside the current conda environment, the instance of pip installed inside the current conda environment is used.
pip and conda have common points and differences. It is hard to explain better than what Jake VanderPlas did here: https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/
For your usecase, it would be best anyway to wipe your earlier pip-installed packages and to rely only on conda. If this is not possible due to the non-availability of packages in conda, you can install pip in conda and then use conda install pip
. (from the link above).
I really want to know the difference between pip and conda
See What is the difference between pip and conda?
and what happens if I use pip to install packages instead of conda?
Pip in general (except for using virtualenv) installs packages either for the whole system (as root/maybe as Administrator), or for the user. Conda installs packages inside its own little world/directory, where they need to be activated, overriding pip's packages, as you already noted.
As a solution, you could install packages via your system first, pip second, and conda thirdly.
So use the system package if it's all that is needed. If that is too old f.ex., you could use pip install.
If you need a specific package, maybe only for one project, or if you need to share the project with someone else, conda seems more appropriate. See also What is the advantage of Pip over Anaconda?.
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