I am new to Linux system and don't have background about operating system.
I have some issues about importing numpy, but I worked it out.
But still have some questions in my mind.
I know that I can use following code to know where Python finds packages
import sys
sys.path()
which in my case gives several options:
/home/twotwo/.local/lib/python3.6/site-packages
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
And I would like to know the difference between them.
I guess that the difference between first and second is caused by the way I download it as cited below, if not please do correct me.
We recommend using an user install, using the --user flag to pip (note: do not use sudo pip, which can cause problems). This installs packages for your local user, and does not write to the system directories.
And the second and third one both have/usr
in the beginning.
But there's still a difference between, one has local
and the other one doesn't.
To summarize my questions:
(1) The difference between:
/home/twotwo/.local/lib/python3.6/site-packages
/usr/local/lib/python3.6/dist-packages
(2) The difference between:
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
(3) Actually, two of these paths have numpy but how does python choose which one to be imported?
Many Thanks to you all, and have a nice day!