-
Notifications
You must be signed in to change notification settings - Fork 303
Description
It took me a long time to understand what was going on. I'm running this on a docker container running an opensuse image. I have found that when I open two powershells and log into the containers using docker exec and run the same command in both windows at almost the exact same time:
env-linux/bin/python3 complexscript.py
Created using virtualenv
Both windows will fail with the weirdest errors, mostly this one:
Traceback (most recent call last):
File "complexscript.py", line 29, in <module>
import requests
ImportError: No module named 'requests'
If I wait a few seconds between running the command in each Powershell, then the scripts run correctly.
I have also found that when I copy this directory to another directory that I just created, say /test then everything works as expected. The difference is that the first directory is actually a docker-compose volume mounted using volumes:. This means that the contents is synchronized to that of a Windows folder on the host.
My conclusion is that there seems to be some kind of file or directory locking going on that is causing these strange issues. I'm sure it's not limited to Python, but that's how I discovered something was wrong.
How can this be solved? Many thanks in advance. I apologize for not using the issue template. I wasn't sure how to explain how this can be reproduced. Let me know if I need to share more information.