Forum Discussion

mfoster711's avatar
mfoster711
Regular Contributor
20 days ago
Solved

__pycache__ folder and pyc files

I just used TestComplete version 15.80 for first time on a project and it created __pycache__ folder that contains pyc files for my scripts. I never had this before. Is it needed? Can you turn it off...
  • Hassan_Ballan's avatar
    20 days ago

    This is normal Python behavior, not something specific to TestComplete.

    When you use Python scripting in TestComplete, it generates .pyc files inside a __pycache__ folder. These are compiled bytecode files used to speed up execution. They’re automatically created and safely regenerated as needed.

    You should not commit them to source control. Add the following to your .gitignore:

    __pycache__/
    *.pyc
    *.pyo

    If they’re already tracked, remove them with:

    git rm -r --cached __pycache__
    git rm --cached *.pyc

    There’s generally no need to disable their creation — just ignore them in Git, which is standard practice for Python projects.

    🤖 AI-assisted response
    👍 Found it helpful? Click Like
    ✅ Issue resolved? Click Mark as Solution