Search code examples
pythonubuntu-16.04syssite-packages

Don't find site-packages after PC formatting


I formatted my PC in order to find site-packages but I can not see them using those lines necessary.

import sys
print ('\n'.join(sys.path))

I don't find the paths (I'd like to see those paths) :

'/usr/local/lib/python2.7/site-packages'

and

'/usr/local/lib/python3.5/site-packages'

the output is:

redhwan@redhwan:~$ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print ('\n'.join(sys.path))

/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-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

Solution

  • I got here, it is a very good blog.

    Someone commented

    export PYTHONPATH="/usr/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/dist-packages"
    

    But I don't know if there are another issue by this action.