Monday, April 1, 2019

Python - important commands

How to get the list of installed packages in your python

using Pip
------------

execute the following command in the environment where you would like to know the list of installed python packages

> pip freeze


If you are having multiple python versions on the same machine, then make sure that you are using the correct version of the pip that you wanted to get the information about.

How to get the paths of the imported packages 

# python 3

import sys
import pprint

# pretty print loaded modules
pprint.pprint(sys.modules)

No comments:

Post a Comment