0
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?

  • 1
    Does this answer your question? [What is the difference between pip and conda?](https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda) – Harun Yilmaz Oct 15 '20 at 12:53

1 Answers1

0

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.

trumpetlicks
  • 7,033
  • 2
  • 19
  • 33
Psychotechnopath
  • 2,471
  • 5
  • 26
  • 47