Why is it that when we import a library, say NumPy for example, we do not need to know the library directory path (i.e. /desktop/python/libaries/NumPy/…)? I ask this because if I make a folder and then put test.py in it, and then outside of that folder make a file named main.py, I will need to do something like “from [foldername] import test.py.” Why is it that when you do pip install, you don’t need to ?
For example, I have a library I installed using pip3 install git+https://github.com/… , but the issue is that when I go into the directory of my project where I want to use this library, it says that the name of the module is not found. I know that it is downloaded, however Python is not able to find it.
Josef Jay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.