Python Forum
[SOLVED] Recommended way to upgrade module?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Recommended way to upgrade module?
#1
Question 
Hello,

When running a script on a Debian 12 host that worked fine on Windows, a method is missing because a module is older on Debian.

What is the recommended fix?

If possible, I prefer to use apt to install packages as an easy way to upgrade things.

Thank you.

Traceback (most recent call last):
  File "blah.py", line 34, in create_events_list
    for event in gcal.events:
                 ^^^^^^^^^^^
AttributeError: 'Calendar' object has no attribute 'events'

#Linux
~# pip freeze | grep icalendar
icalendar==4.0.3
~# python3 --version
Python 3.11.2

#Windows
pip freeze | findstr icalendar
icalendar==6.3.2
py --version
Python 3.13.2

apt install python3-icalendar --upgrade
python3-icalendar is already the newest version (4.0.3-5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reply
#2
If you don't use virtualenvs (you should), you can perhaps install icalendar separately for your user with
Output:
python3 -m pip install --user --upgrade icalendar
« We can solve any problem by introducing an extra level of indirection »
Reply
#3
Thanks, I'll check it out
Reply
#4
(Apr-18-2026, 03:20 PM)Winfried Wrote: If possible, I prefer to use apt to install packages as an easy way to upgrade things.
This heavily conflicts your interest. Debian and distros based on Debian are stable release distribution, which means that as a standard there will be _no_ version jump within a release. You get bugfix releases (hopefully) and that's about it. If you want to use APT only and the Python package $FOO is too old, the only way to resolve this to wait for the next Debian release and hope that the Python package needed is new enough coming from Debian's repos.

However, using virtual environments and install within those via pip packages is need is the way to go. Especially is it isolates Python packages in the venv from system's packages. Which is a _really_ (!) important point for most Linux distros, as Python and certain Python packages are integral part of the system's installation and breaking them may lead worst case to a not working Linux installation. On Windows, it's less critical, as Windows itself does not use and does not rely on Python. But it is still a very good idea to isolate different projects in different venvs.

In other words: if you don't use venvs yet -> start using them now. There is a basic explanation on venvs in the Python tutorial plus a gazillion other sites on the internet explaining it, as using venvs for Python is pretty much standard and recommended practice.

Regards, noisefloor
Winfried likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] Recommended way to declare global variable? Winfried 1 90 Mar-19-2026, 09:30 PM
Last Post: deanhystad
Question Recommended data structure for this? Winfried 6 190 Feb-16-2026, 11:05 PM
Last Post: Pedroski55
Question [SOLVED] Upgraded Python: Module no longer found Winfried 1 2,893 Jan-01-2025, 02:43 PM
Last Post: Larz60+
  SOLVED: Install mailer module in Python 3.11.2? Calab 3 3,705 Jul-03-2024, 02:03 PM
Last Post: Calab
  Recommended way to read/create PDF file? Winfried 3 18,942 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  Python Version upgrade nitinkukreja 1 2,420 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  [SOLVED] Tkinter module not found Milan 7 60,603 Aug-05-2022, 09:45 PM
Last Post: woooee
  No Module found in other directory than source code [SOLVED] AlphaInc 1 4,122 Nov-10-2021, 04:34 PM
Last Post: AlphaInc
  Upgrade from 3.7.9 to 3.7.11 quazirfan 4 10,866 Sep-08-2021, 01:02 AM
Last Post: quazirfan
  Upgrade pip error karunas 3 15,357 Nov-26-2020, 11:40 AM
Last Post: buran

Forum Jump:

User Panel Messages

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