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:

1
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
  writing and running code in vscode without saving it akbarza 5 2,203 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 597 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 2,215 Jun-28-2024, 07:02 AM
Last Post: Samuel34
  run part of a script with a different version of Python jdog 3 2,225 May-27-2024, 01:57 AM
Last Post: Alice12
  problem in running a code akbarza 7 2,233 Feb-14-2024, 02:57 PM
Last Post: snippsat
  the order of running code in a decorator function akbarza 2 1,284 Nov-10-2023, 08:09 AM
Last Post: akbarza
  How to resolve version conflicts in Python? taeefnajib 0 1,967 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  Python venv and PIP version issue JanOlvegg 2 3,150 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Python Version upgrade nitinkukreja 1 1,671 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  Code running many times nad not just one? korenron 4 2,155 Jul-24-2022, 08:12 AM
Last Post: korenron

Forum Jump:

User Panel Messages

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