pip install package-name
conda install package-name
I installed a package with pip and conda. When I import it in python, which one is I am using exactly? And how can I change it?
pip install package-name
conda install package-name
I installed a package with pip and conda. When I import it in python, which one is I am using exactly? And how can I change it?
It all depends on what environment you are using, and where you run the install commands! pip
goes together with venv
, or virtual environments. conda
goes together with conda environments.
Basically, pip
and conda
are both package installers. venv
and conda
environments are used to seperate python projects which might have different dependencies (For example, different python projects could require different versions of numpy
or tensorflow
).
When you import
a package, where things get imported from depends on which environment you activated, or to which interpreter your python shell/IDE is linking at the moment.