0

pip3 install [package] works for me for installing the package but when I ran the file calling this package it said it can't find the package.

When I tried py -m pip install [package] it installed the package and the package is found by the file.

I'm curious about the function of py -m. Did I install the package in another place with the second command?

wjandrea
  • 28,235
  • 9
  • 60
  • 81
Joy
  • 333
  • 2
  • 6
  • 1
    its the same as `python -m pip` by using it in this way it is easier to ensure that you are installing the package into the right python variant ... `python -m XXX` says to python to run the `__main__.py` that is found in the module (XXX) as a script – Joran Beasley May 03 '23 at 23:17
  • `py -m` is to run a module in the current dir such as [porcupine](https://github.com/Akuli/porcupine). – TRCK May 03 '23 at 23:20

0 Answers0