1

I am trying to find a way to tell which modules were originally shipped within a python version and which ones I have installed manually via pip-install.

Unfortunately I did not set up virtual environments for my projects and am now facing the problem to find out which modules I have to include if I want to deploy my project elsewhere (on another machine).

It is easy to parse the import / from x import z statements in the projects but then I would need to find out which of these do not come with a fresh python install.

It may be possible to back up the current python directory, download and install python from scratch and diff the folders. But - there must be a BetterWay (TM)?!

Thanks in advance!

Fab
  • 213
  • 3
  • 15
  • `pip freeze` (and pipe to file) should tell you what you have installed. – doctorlove May 21 '19 at 08:41
  • Depending on what OS you're using, you could check if the packages you installed with `pip` were installed in the [site-packages instead of dist-packages directory](https://stackoverflow.com/questions/9387928/whats-the-difference-between-dist-packages-and-site-packages). Otherwise you could try listing the packages in the dist-packages directory by date and see if the packages you might have installed were modified later than the original set of packages. However, I'm not sure when and how those packages get updated so that might make it harder for you to distinguish between the two types. – D Malan May 21 '19 at 08:56
  • Thanks doctorlove - pip freeze solves my problem! – Fab May 21 '19 at 08:59

0 Answers0