[TIP] tox? "_abcoll.pyc: No such file or directory" from python2.7 when using python3.3?

Chris Withers chris at simplistix.co.uk
Mon Jun 10 08:45:05 PDT 2013


On 09/06/2013 22:46, Chris Withers wrote:
>>> Can anyone shed any light on what's going wrong here:
>>>
>>> http://jenkins.simplistix.co.uk/job/xlrd/37/TOXENV=py33,label=mac/console
>>>
>>>
>>> error: .tox/python/lib/python2.7/_abcoll.pyc: No such file or directory
>>>
>>> ...but this is py33, and the py27 env on the same box runs fine:
>>>
>>> http://jenkins.simplistix.co.uk/job/xlrd/37/TOXENV=py27,label=mac/console

Hmm, well, I dug into this and killed with a big hammer.

So, starting here:

MiniMe:~ chris$ sudo -u jenkins -i

MiniMe:~ jenkins$ cd /Users/Shared/Jenkins/Home/workspace/xlrd/0e321e7b
MiniMe:0e321e7b jenkins$ 
/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/bin/python 
-c "import tox; tox.cmdline();" -c tox.ini
GLOB sdist-make: /Users/Shared/Jenkins/Home/workspace/xlrd/0e321e7b/setup.py
ERROR: invocation failed, logfile: 
/Users/Shared/Jenkins/Home/workspace/xlrd/0e321e7b/.tox/log/tox-0.log
ERROR: actionid=tox
msg=packaging
cmdargs=['/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/bin/python', 
local('/Users/Shared/Jenkins/Home/workspace/xlrd/0e321e7b/setup.py'), 
'sdist', '--formats=zip', '--dist-dir', 
local('/Users/Shared/Jenkins/Home/workspace/xlrd/0e321e7b/.tox/dist')]
env=None
running sdist
running check
error: .tox/python/lib/python2.7/_abcoll.pyc: No such file or directory

ERROR: FAIL could not package project

Okay, well, at least I could reproduce. Breaking this down to the 
problem, I found:

MiniMe:0e321e7b jenkins$ 
/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/bin/python 
setup.py sdist
running sdist
running check
error: .tox/python/lib/python2.7/_abcoll.pyc: No such file or directory

Okay, but how on earth can running sdist end up like this? Especially given:

MiniMe:0e321e7b jenkins$ 
/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/bin/python 

Python 3.3.0 (default, Jan 30 2013, 22:04:37)
[GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.12)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys
 >>> print(sys.path)
['', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python3.3/site-packages/distribute-0.6.31-py3.3.egg', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python3.3/site-packages/pip-1.2.1-py3.3.egg', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python33.zip', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python3.3', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python3.3/plat-darwin', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python3.3/lib-dynload', 
'/usr/local/lib/python3.3', '/usr/local/lib/python3.3/plat-darwin', 
'/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python3.3/site-packages']

So, how does .tox/python/lib/python2.7/ end up on sys.path anyway? Never 
did find that out, however:

MiniMe:0e321e7b jenkins$ ls -lah .tox/python/lib/python2.7/_abcoll.pyc
lrwxr-xr-x  1 jenkins  jenkins    85B Jan 30 23:12 
.tox/python/lib/python2.7/_abcoll.pyc -> 
/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python2.7/_abcoll.pyc
MiniMe:0e321e7b jenkins$ ls -lah 
/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python2.7/_abcoll.pyc
ls: 
/Users/Shared/Jenkins/Home/shiningpanda/jobs/7dd0339e/tools/lib/python2.7/_abcoll.pyc: 
No such file or directory

Well, okay, so that's it, but I have no idea how that could have ever 
happened anyway :-(

Big hammer time:

MiniMe:0e321e7b jenkins$ rm -rf .tox/

...and hey presto, passing job:

http://jenkins.simplistix.co.uk/job/xlrd/TOXENV=py33,label=mac/49/

:'(

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk



More information about the testing-in-python mailing list