-1

When you import a library in Python, where do you import it from? For example, if you do import math, where does it come from? Why couldn't it be included in the first place?

Red
  • 26,798
  • 7
  • 36
  • 58
racecarmd
  • 11
  • 3
  • That's part of the standard library that comes distributed with the python runtime – juanpa.arrivillaga Feb 18 '21 at 04:36
  • 2
    Please go through the [intro tour](https://stackoverflow.com/tour), the [help center](https://stackoverflow.com/help) and [how to ask a good question](https://stackoverflow.com/help/how-to-ask) to see how this site works and to help you improve your current and future questions, which can help you get better answers. Stack Overflow is not intended to replace existing tutorials and documentation. Please read about the origins and uses of external libraries. Stack Overflow is not a conduit for personal tutorial discussions. – Prune Feb 18 '21 at 04:37
  • This link may help you on more info: https://stackoverflow.com/questions/18857355/where-are-math-py-and-sys-py – sonulohani Feb 18 '21 at 04:43

2 Answers2

1

"When you import a library in Python, where do you import it from?"

  • Python has the standard library. All the modules are located there.

"Why couldn't it be included in the first place?"

  • Because it is the syntax of Python.
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts) – Red Feb 18 '21 at 04:44
1

Is a module that comes with the standard library that comes by default from the python packages.

Libraries not needed by the default don’t need to be imported by default, they makes your program heavy and slow for processing.

import math - module from standard library, not needed in all programming project.