Tox fails installing sdist in python3.3

Issue #168 on hold
Martin Häcker
created an issue

I'm hosting tox on python 2.7and am getting errors like this:

GLOB sdist-make: /Users/dwt/Code/Projekte/pyexpect/
py26 inst-nodeps: /Users/dwt/Code/Projekte/pyexpect/.tox/dist/
py26 runtests: PYTHONHASHSEED='3320894281'
py26 runtests: commands[0] | /Users/dwt/Code/Projekte/pyexpect/.tox/py26/bin/python
Ran 34 tests in 0.245s

py27 inst-nodeps: /Users/dwt/Code/Projekte/pyexpect/.tox/dist/
py27 runtests: PYTHONHASHSEED='3320894281'
py27 runtests: commands[0] | /Users/dwt/Code/Projekte/pyexpect/.tox/py27/bin/python
Ran 34 tests in 0.182s

Traceback (most recent call last):
  File "/Users/dwt/Library/Python/2.7/bin/tox", line 9, in <module>
    load_entry_point('tox==1.7.1', 'console_scripts', 'tox')()
  File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/", line 26, in main
    retcode = Session(config).runcommand()
  File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/", line 303, in runcommand
    return self.subcommand_test()
  File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/", line 440, in subcommand_test
    if self.setupenv(venv):
  File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/", line 370, in setupenv
  File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/", line 47, in set_python_info
    "import sys; "
  File "/Users/dwt/Library/Python/2.7/lib/python/site-packages/py-1.4.20-py2.7.egg/py/_path/", line 673, in sysexec
    stdout, stderr,)
py.process.cmdexec.Error: ExecutionFailed: 1  /Users/dwt/Code/Projekte/pyexpect/.tox/py33/bin/python
Your PYTHONPATH points to a site-packages dir for Python 2.x but you are running Python 3.x!
     PYTHONPATH is currently: "/sw/lib/python2.6/site-packages:/Users/dwt/Library/Homebrew/lib/python2.7/site-packages"
     You should `unset PYTHONPATH` to fix this.

This is what my .tox-file looks

envlist = py26, py27, py33
#, pypy

commands = {envpython}

setenv =

As far as I can tell, what is missing is that at the call to pythonexecutable.sysexec() is missing the environment variable PYTHONPATH='' that is set in the setenv line in the tox file. I don't however understand how to do that. :/ So no patch from me for now.

Just quickly splicing in a env=dict(PYTHONPATH='') into that call seems to work around the issue.

Do you need any more information to fix this?

Comments (3)

  1. Sorin Sbarnea

    Any ideas on how to fix this, it seems that I get the same errors and I tried to use the setenv approach but it seems that does not have any effect. Any workarounds?

  2. Log in to comment