Python Keeps Using Old Version Of Script

I’ve tried 2.47 x32, 2.48 x32 and 2.48 x64, with the same results.

I can modify my scripts a few times and Blender uses the updated versions, but then, for some unkown reason, Blender stops using the updated versions, as I change them. I’ve never had this problem before 2.47.

Previously I’ve encoded 1,000s of lines of Python code for use in the Blender GE, using both internal and external text files, and didn’t have this problem before.

My Blender and Python setup is correct, as usual. Perhaps the fact that I copied the Blender 2.48 x64 zip into my Blender 2.47 x32 program folder, and back and forth a few times, may have corrupted the necessary files somehow???

I don’t know why Blender hangs onto and uses old versions of Python files, even after I’ve modified them and reloaded them, and deleted them, and deleted the .pyc files.

However, when I copy different versions of Blender, say from 2.48 x64 over 2.47 x32, or vice versa, then Blender will use the updated Python files, but only for a few changes, then it stops again. WTF can I do??? :frowning:

Blender reads at start time ALL scripts form standard scripts folder and from ALL its sub-folders!. If there are multiple versions of your script, it is not guaranteed the newest version will be imported. Remove or rename other versions (from “.py” to e.g. “.pyX”), so blender not recognize them as python scripts.

Thanks for your speedy reply Migius, however, I’ve even deleted the file from the folder and from within the Blender Python Editor, and Blender would still use the old version. I think it’s a bug in Blender, because whenever I re-install Blender or shutdown my computer or re-start Blender, the new version is used, at least until I make a few changes, and then for some reason Blender will again start to use only the old version. Oh well, I guess I’ll just have to shutdown or re-install to make this work. :frowning:

be sure to delete any pyc files with the same name.
the other issue is that your blend file may be pointing to an old scripts folder. Check ur User Prefs.

PapaSmurf, I have deleted the .pyc files and verified the scripts folder. The only fix that works is to re-start Blender, or re-install, or shutdown. :frowning:

I have the init.py script as internal and the other script as external - I like to use the IDLE Python editor. I tried using both as internal and both as external, still no luck. All it takes is one change to either the internal or external file and Blender will just ignore the updated file and use the previous version.

Why would Blender hang onto files that have been deleted both internally and externally? And if so, why don’t the scripts show up in the Outliner, like everything else does. I could at least delete it from there then.

Yeah, it’s because they’re loaded on memory I think. Why is it so hard to open and close blender?
You can delete them by the text editor.

Perhaps the fact that I copied the Blender 2.48 x64 zip into my Blender 2.47 x32 program folder, and back and forth a few times, may have corrupted the necessary files somehow?

well, that wont help at all.
always use update menu’s when transferring scripts.
set user pref. script location for both x64 & x32 versions.
one recent error I have found is .blender/scripts no longer accepts some file types,
so if you use other data files with your scripts, they must now be placed outside .blender/scripts.
for some reason they can vanish python scripts from the menu.

These are some of the debugging procedures I use & some of the solutions.
hope this helps.

I have noticed this problem too when working on Blendigo SW updates.
I believe it was reported as a bug recently and was fixed but then again apparently not :frowning:
The issue manifested itself for me when I made a series of edits to the script and then AltP to check the changes and the script ran as it was before hand.
Even when I saved the script changes and AltP is would not run as changed.
HTH