Python Forum
How to see the date of installation of python modules.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to see the date of installation of python modules.
#1
Hi again!

As my knowledge is still very very limited, I learn mostly by imitating code and then later on, I expand it or manipulate it, till I get what I want.

Due to some trials and errors, I have added quite a few modules to python. I'd like to identify them by date of installation, and then to eliminate them to free space on my computer.

I tried some options that didn't work. Some others, I don't understand, as the commands are for Linux and they don't seem to work on Windows.

Finally, I found some code that seemingly works:

import pkg_resources, os, time

for package in pkg_resources.working_set:
    print("%s: %s" % (package, time.ctime(os.path.getctime(package.location))))
but actually I think it doesn't, because ALL modules are shown with the same date and time, as you can see on this excerpt:

[...]
PyYAML 6.0: Tue Feb  7 01:43:59 2023
PyQt5 5.15.7: Tue Feb  7 01:43:59 2023
PyQtWebEngine 5.15.4: Tue Feb  7 01:43:59 2023
isort 5.9.3: Tue Feb  7 01:43:59 2023
psutil 5.9.0: Tue Feb  7 01:43:59 2023
traitlets 5.7.1: Tue Feb  7 01:43:59 2023
[...]
I also find it strange that the list is not alphabetically ordered, neither it is by date, as all modules are shown with the exact same date and time.

Did I make some mistake with the code?

Thanks for your help,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
How to see the date of installation of python modules. - by newbieAuggie2019 - Mar-31-2023, 08:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  White Screen Issue with Toolbar After Python Installation evelynfreya 3 1,413 Apr-30-2025, 06:43 AM
Last Post: encore
  Install a module to a specific to Python Installation (one of many)) tester_V 2 2,570 Oct-29-2024, 03:25 PM
Last Post: snippsat
  Shrink Python installation? Extract site-packages from .zip only on demand? pstein 4 1,916 Oct-28-2024, 04:29 PM
Last Post: snippsat
Bug Python 3.12 cannot import local python files as modules sunflowerdog 25 24,437 Jul-31-2024, 01:52 PM
Last Post: sunflowerdog
  Troubleshooting Jupyter Notebook installation with Python using pip and a venv Drone4four 1 2,729 Jun-04-2024, 10:55 PM
Last Post: Drone4four
  Compare current date on calendar with date format file name Fioravanti 1 2,312 Mar-26-2024, 08:23 AM
Last Post: Pedroski55
  Python date format changes to date & time 1418 4 2,988 Jan-20-2024, 04:45 AM
Last Post: 1418
  Python installation for old MacOS Yonix 1 1,169 Sep-21-2023, 03:32 PM
Last Post: menator01
  Installation of packages to newest Python version from previous one Andrzej_Andrzej 3 5,208 Jul-15-2023, 11:32 AM
Last Post: snippsat
  Getting "SSL client not supported by this Python installation" error prabirsarkar 0 1,713 Mar-13-2023, 05:01 PM
Last Post: prabirsarkar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020