On Wed, Jun 6, 2012 at 11:12 PM, Adrian Petrescu <span dir="ltr">&lt;<a href="mailto:apetresc@gmail.com" target="_blank">apetresc@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey guys,<div><br></div><div>I have a fairly simple 3-module python project that I&#39;m testing successfully using Tox, on Python 2.6 and 2.7. The tox configuration is almost completely vanilla, nothing special there. Everything works fine when I run tox directly on my OS X development machine.</div>

<div><br></div><div>However, things go wrong when trying to run this on my Jenkins server (running Ubuntu 12.04). I have tried to set up Tox to run both directly through the Python plugin for Jenkins (where I invoke Tox directly from a Python script using tox.cmdline()) as well as through the ShiningPanda plugin. In both cases, and for both Python 2.6 and 2.7, I get the following error:</div>

<div><br></div><div><span style="font-size:11px;white-space:pre-wrap;font-family:monospace">_________________________________ [tox sdist] __________________________________
[TOX] ***creating sdist package
[TOX] /var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts$ /usr/bin/python setup.py sdist --formats=zip --dist-dir .tox/dist &gt;.tox/log/0.log
[TOX] ***copying new sdistfile to &#39;/var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts/.tox/distshare/ServiceTemplates-1.0.zip&#39;
______________________________ [tox testenv:py27] ______________________________
[TOX] ***creating virtualenv py27
[TOX] /var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts/.tox$ /usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py --distribute --no-site-packages py27 &gt;py27/log/0.log
[TOX] ERROR: invocation failed, logfile: /var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts/.tox/py27/log/0.log
[TOX] ERROR: /var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts/.tox$ /usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py --distribute --no-site-packages py27 &gt;py27/log/0.log
The --no-site-packages flag is deprecated; it is now the default behavior.
New python executable in py27/bin/python2.7
Also creating executable in py27/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...
  Error [Errno 2] No such file or directory while executing command /var/lib/jenkins/wor...y27/bin/easy_install /usr/local/lib/pytho...pport/pip-1.1.tar.gz
...Installing pip...done.
Traceback (most recent call last):
  File &quot;/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py&quot;, line 2270, in &lt;module&gt;
    main()
  File &quot;/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py&quot;, line 928, in main
    never_download=options.never_download)
  File &quot;/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py&quot;, line 1042, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File &quot;/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py&quot;, line 640, in install_pip
    filter_stdout=_filter_setup)
  File &quot;/usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py&quot;, line 966, in call_subprocess
    cwd=cwd, env=env)
  File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 679, in __init__
    errread, errwrite)
  File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

[TOX] ERROR: InvocationError: /usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py --distribute --no-site-packages py27 (see /var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts/.tox/py27/log/0.log)
________________________________ [tox summary] _________________________________
[TOX] ERROR: py27: InvocationError: /usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py --distribute --no-site-packages py27 (see /var/lib/jenkins/workspace/Service Templates/TOXENV/py27/scripts/.tox/py27/log/0.log)
Build step &#39;Execute Python script&#39; marked build as failure
Recording test results
Finished: FAILURE
</span></div><div><span style="font-size:11px;white-space:pre-wrap;font-family:monospace"><br></span></div><div><div>The baffling part is that <b>running tox directly on the Linux box, even as the jenkins user, works just fine!</b> This issue <i>only</i> shows up when run through Jenkins, but in that case it shows up no matter how I invoke it (ShiningPanda, Python, etc.).</div>

</div><div><br></div><div>I feel I must have a simple misconfiguration here, but the stack trace is completely opaque to me. Does anyone have any insight they can provide?</div></blockquote><div><br></div><div>This is a complete guess, but is it possible that your issue is the same issue as this?</div>
<div><br></div><div><a href="https://github.com/pypa/virtualenv/issues/278">https://github.com/pypa/virtualenv/issues/278</a></div><div><br></div><div>I notice that this path has a space in the name: <span style="font-family:monospace;font-size:12px;white-space:pre-wrap">/var/lib/jenkins/workspace/</span><span style="font-family:monospace;font-size:12px;white-space:pre-wrap">Service Templates/TOXENV/py27/scripts</span></div>
<div><br></div><div>Incidentally, I recently experienced the same error and stack trace, but in a slightly different context:</div><div><br></div><div><a href="https://github.com/pypa/virtualenv/issues/281">https://github.com/pypa/virtualenv/issues/281</a></div>
<div><br></div><div>In both cases, it looks like the easy_install is not getting installed when virtualenv installs distribute.</div><div><br></div><div>--Chris</div><div><br></div></div>