(Jul-11-2019, 11:14 AM)srm Wrote: when we install numpy or any other packages with pip command on windows,
where exactly the numpy files are getting stored in path...
It get stored in
site-packages folder eg
C:\Python37\Lib\site-packages\numpy Quote:how do we locate those files with help of python command??
Python locate it for you when using
import,you never need to go yourself to
site-packages folder.
C:\ λ python Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> >>> np.arange(15).reshape(3, 5) array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]])
How it work as looked upon from outside.
Windows find Python when it set in
Environment Variables Path,this get done automatically under install if mark on eg
Add Python 3.7 to PATH Python finds files(module/package) by looking in
sys.path.
>>> import sys >>> >>> sys.path # List get back here is where Python look
srm Wrote:and also how to check details functions of any package eg:numpy with
python command
From command line:
C:\ λ pip show numpy Name: numpy Version: 1.16.3 Summary: NumPy is the fundamental package for array computing with Python. Home-page: https://www.numpy.org Author: Travis E. Oliphant et al. Author-email: None License: BSD Location: c:\python37\lib\site-packages Requires: Required-by: wxPython, pyxel, pandas, moviepy, matplotlib, imageio
From interpreter:
C:\ λ python Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> >>> np.__version__ '1.16.3'