[Python-ideas] "import me" to display some summary of the current python installation

Kamal Mustafa kamal.mustafa at gmail.com
Wed Apr 12 09:35:56 EDT 2017


Never mind. site._script() as pointed out by Wes Turner is what I need:-

Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> site._script()
sys.path = [
    '',
    '/usr/lib/python3.4',
    '/usr/lib/python3.4/plat-x86_64-linux-gnu',
    '/usr/lib/python3.4/lib-dynload',
    '/usr/local/lib/python3.4/dist-packages',
    '/usr/lib/python3/dist-packages',
]
USER_BASE: '/home/kamal/.local' (exists)
USER_SITE: '/home/kamal/.local/lib/python3.4/site-packages' (doesn't exist)
ENABLE_USER_SITE: True

On 12 April 2017 at 09:56, Kamal Mustafa <kamal.mustafa at gmail.com> wrote:
> On the same theme with "import this" and "import antigravity", "import
> me" I think can be both some fun way to introduce Python and also
> offer a helpful functionality when troubleshooting python installation
> with someone new to the language.
>
> Currently, we have to use some myriad approach like "show me the
> output of `which python`" to know the basic info of the python
> installation someone having trouble or asking question.


More information about the Python-ideas mailing list