Python Forum
Python keeps running the old version of the code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python keeps running the old version of the code
#1
Hello
I have a very weird problem
I am using ubuntu 20.04
I am running my code in terminal like that:

python3 code.py
ALthoguh I change some line in the code, it keeps running the old version of the code

What causes it?
I am quite confused...
Reply
#2
I did not understand what happened exactly but I reactivated anaconda stuff and it is now okay ...
Reply
#3
To be fair, I never run into that problem myself. And I mean you already solved it yourself, but I would like to give you a bit of context. Also I am quite sure you may run into that again.
So I assume that you restartet the python3 call and made sure to save your file before that. I bet you did, just wanting to mention it.
What anaconda likes to do is to cache your modules and reuse them.
What you can do to prevent this is explained here:
https://stackoverflow.com/questions/4566...ng-modules
quest likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python version 3.11.15 install skip74 1 44 Apr-08-2026, 05:59 PM
Last Post: noisefloor
Photo Running Brackets code Jojogeno 2 89 Feb-13-2026, 10:30 AM
Last Post: buran
  code not running even without errors Azdaghost 2 1,079 Apr-25-2025, 07:35 PM
Last Post: Azdaghost
  python code not running Azdaghost 1 828 Apr-22-2025, 08:44 PM
Last Post: deanhystad
  writing and running code in vscode without saving it akbarza 5 4,894 Mar-03-2025, 08:14 PM
Last Post: Gribouillis
  Python: How to import data from txt, instead of running the data from the code? Melcu54 1 1,352 Dec-13-2024, 06:50 AM
Last Post: Gribouillis
  How to find out from outside Python (in Windows) the current version of Python? pstein 5 4,540 Jun-28-2024, 07:02 AM
Last Post: Samuel34
  run part of a script with a different version of Python jdog 3 3,862 May-27-2024, 01:57 AM
Last Post: Alice12
  problem in running a code akbarza 7 3,348 Feb-14-2024, 02:57 PM
Last Post: snippsat
  the order of running code in a decorator function akbarza 2 1,969 Nov-10-2023, 08:09 AM
Last Post: akbarza

Forum Jump:

User Panel Messages

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