What is the difference between installing a module with pip/setup.py vs adding it to PYTHONPATH?

  Kiến thức lập trình

I have a custom Python module I want to use in another project. I have two options:

  1. Add a setup.py and install the module locally with pip.
  2. Add the location of the module to the PYTHONPATH environment variable.

What are the tradeoffs? I know instinctively that using pip with a setup.py should be preferred, but can’t point to any concrete evidence why.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT