Home:ALL Converter>How do I find obsolete python modules?

How do I find obsolete python modules?

Ask Time:2014-02-25T06:04:03         Author:throwaway17434

Json Formatter

I have written a program in python 3.3 and I am using WinPython and Inno to make a portable python installation. However, there are a lot of modules in the WinPython installation that I do not really need in my program. Is there a way to find all modules of a python installation that are not used by a random script?

Example: Lets say I have installed numpy and matplotlib and my program does this:

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0,2*np.pi,100)
y = np.sin(x)

plt.plot(x,y)
plt.show()

I want to delete all files in the python installation, that are not needed to run this program.

Author:throwaway17434,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22000044/how-do-i-find-obsolete-python-modules
yy