I am using both "pip freeze" and "conda list" to list the packages installed in my environment, but what are their differences?
1 Answer
If the goal only is to list all the installed packages, pip list
or conda list
are the way to go.
pip freeze
, like conda list --export
, is more for generating requirements files for your environment. For example, if you have created a package in your customized environment with certain dependencies, you can do conda list --export > requirements.txt
. When you are ready to distribute your package to other users, they can easily duplicate your environment and the associated dependencies with conda create --name <envname> --file requirements.txt
.
The differences between conda
and pip
need a longer discussion. There are plenty of explanations on StackOverflow. This article by Jake VanderPlas is a great read as well.
You might also find this table useful. It lists operation equivalences between conda
, pip
and virtualenv
.
-
1
-
1Thanks a lot for noticing this! I wonder if this has something to do with the fact that fewer people could need
virtualenv
these days (pyenv
andpipenv
might have become the more dominant forces). Just corrected the link and limited the comparison to be betweenpip
andconda
(virtualenv
no longer listed).– Shan DouAug 19, 2019 at 15:50 -
5This site is my docs - always like to fix em ;-) - I added virtualenv again (it's in the table if you scroll right), feel free to delete the reference to it if you feel it reads better. (:– drevickoAug 20, 2019 at 1:57
-
2I came here looking for
conda list --export
. Consider another question answered from someone starting out with conda after using pip first. Aug 7, 2020 at 22:26 -
While my code is running without any error, when I follow the "conda list --export > requirements.txt" and "conda create --name <envname> --file requirements.txt" I got "Found conflicts! Looking for incompatible packages." , and cannot create environment. Any idea ? Mar 17, 2021 at 14:32
requiremen_{pip or conda}.py
? Or how do I solve this issue and install everything correctly?