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
  problem in running a code akbarza 7 642 Feb-14-2024, 02:57 PM
Last Post: snippsat
  writing and running code in vscode without saving it akbarza 1 386 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  run part of a script with a different version of Python jdog 2 452 Jan-09-2024, 08:49 PM
Last Post: jdog
  the order of running code in a decorator function akbarza 2 522 Nov-10-2023, 08:09 AM
Last Post: akbarza
  How to find out from outside Python (in Windows) the current version of Python? pstein 4 742 Oct-04-2023, 10:01 AM
Last Post: snippsat
  How to resolve version conflicts in Python? taeefnajib 0 923 Apr-27-2023, 08:37 PM
Last Post: taeefnajib
  Python venv and PIP version issue JanOlvegg 2 1,270 Feb-22-2023, 02:22 AM
Last Post: JanOlvegg
  Python Version upgrade nitinkukreja 1 903 Feb-04-2023, 10:27 PM
Last Post: Larz60+
  Code running many times nad not just one? korenron 4 1,364 Jul-24-2022, 08:12 AM
Last Post: korenron
  Can't update new python version on Pycharm GOKUUUU 6 3,829 Jul-23-2022, 09:24 PM
Last Post: GOKUUUU

Forum Jump:

User Panel Messages

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