<div>I&#39;m using Tox with Jenkins to run several selenium tests. Everything is good but every now and then I get the follow error:</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">IOError: [Errno 2] No such file or directory: &#39;/var/lib/jenkins/.tox/</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">jenkins/lib/python2.7/site-</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">packages/Distutils-1.0-py2.7.</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">egg-info&#39;</span></div>

<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">Looking at the log (when it works), I think the issue is this:</font></div><div><font color="#222222" face="arial, sans-serif"><br>

</font></div><div><font color="#222222" face="arial, sans-serif"><div>Installing collected packages: Distutils</div><div><br></div><div>  Found existing installation: Distutils 1.0</div><div><br></div><div>    Uninstalling Distutils:</div>

<div><br></div><div>      Removing file or directory /var/lib/jenkins/.tox/jenkins/lib/python2.7/site-packages/Distutils-1.0-py2.7.egg-info</div><div>      Successfully uninstalled Distutils</div><div><br></div><div>I think what is happening is that if 2 or more tox are running at the same time, while one is Uninstalling Distutils, then another one tries to do the same thing (and since the other one already did it, it can&#39;t find it and throws an IO error). </div>

<div><br></div><div>So:</div><div>ToxA -&gt; Finds the Distutils installation</div><div>ToxB -&gt; Also finds it</div><div>ToxA -&gt; Delete it</div><div>ToxB -&gt; Try to delete (fails)</div><div><br></div><div>So my questions are: </div>

<div>- Why is Distutils being deleted? (noob when it comes to it)</div><div>- Is there a way to avoid this?</div><div>- How are you guys using Tox with Jenkins? I&#39;m just calling tox -e jenkins path/to/test.py. Is there a better way?</div>

<div>- sbt and other building tools usually have locking mechanisms for these kind of things. Why doesn&#39;t Tox? (if it does, how do I turn it on?). </div><div><br></div><div>Thanks,</div></font><div>~Pedro</div>
</div>