Ipython to see environment in remote notebook

In a remote notebook that I didn’t create, can iPython show me the versions of packages that are pre-installed? Thanks.

in this particular case you can find the packages easily by starting to explore the filesystem with os.listdir(path='/') (you need to import os of course).

after some exploring you will find the packages with this.

import os
os.listdir(path='/lib/python3.11/site-packages/')
1 Like

I’m loading a different notebook that’s not public. os.listdir(path='/') returns the following folders.

[‘lib’,
‘boot’,
‘bin’,
‘usr’,
‘etc’,
‘run’,
‘root’,
‘proc’,
‘lib64’,
‘var’,
‘home’,
‘dev’,
‘media’,
‘sys’,
‘sbin’,
‘mnt’,
‘tmp’,
‘srv’,
‘opt’,
‘.dockerenv’]

os.listdir(path='/lib/') returns subfolders: [‘lsb’, ‘udev’, ‘terminfo’, ‘x86_64-linux-gnu’, ‘systemd’, ‘cpp’, ‘init’].

The server info is below.
image

In order to find its installed packages, how can I find where Python 3.7.6 is? Thanks.

could be in /usr/lib/python…
or in the /home/username/.local/lib/python…
or in a venv folder somewhere.
you have to search harder i guess :smiley:

1 Like