Deafult Python packages are installed in : /usr/lib/python2.7
argparse.py , os.py, calender.py, glob.py..............are default python modules.
External or Third party Modules are in : /usr/lib/python2.7/dist-packages/
Files will be installed into subdirectories of
site.USER_BASE
(written
as userbase
hereafter). This scheme installs pure Python modules and
extension modules in the same location (also known as site.USER_SITE
).
Here are the values for UNIX, including Mac OS X:Type of file | Installation directory |
---|---|
modules | userbase/lib/pythonX.Y/site-packages |
scripts | userbase/bin |
data | userbase |
C headers | userbase/include/pythonX.Y/distname |
Examples:
To locate where opencv's 'cv2.so' files installed?
sudo find / -name "cv2.so"
/home/arun/opencv/build/lib/cv2.so
/usr/local/lib/python2.7/dist-packages/cv2.so
python notebook has to be aware of this location so that it recognises cv2 while importing. Lets check it out in the notebook.
print os.sys.path
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-i386-linux-gnu',
'/usr/lib/python2.7/lib-tk'
, '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/local/lib/python2.7/dist-packages/IPython/extensions',
'/home/arun/.ipython']
No comments:
Post a Comment