I had this same problem but for me it wasn't about pycache. My issue was that I was running pytest from a directory that contained a cloned git repo of a custom pytest plugin and a folder with the test files that made use of that plugin.
The solution was to move the cloned repo folder outside of the scope of pytest execution which is the current directory or subdirectory of the from where the command is executed.