Issues

Issue #169 new

Tox fails to create python 3.3 venv

dwt
created an issue

While trying to create a virtualenv for python 3.3 I'm getting the following error:

% tox --develop -v --recreate -e py33
using tox.ini: /Users/dwt/Code/Projekte/pyexpect/tox.ini
using tox-1.7.1 from /Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/__init__.pyc
py33 recreate: /Users/dwt/Code/Projekte/pyexpect/.tox/py33
ERROR: UnsupportedInterpreter: python2.5 is not supported anymore, sorry
___________ summary ____________
ERROR:   py33: UnsupportedInterpreter: python2.5 is not supported anymore, sorry

What is supposed to happen is this:

% PYTHONPATH='' tox --develop -v --recreate -e py33
using tox.ini: /Users/dwt/Code/Projekte/pyexpect/tox.ini
using tox-1.7.1 from /Users/dwt/Library/Python/2.7/lib/python/site-packages/tox-1.7.1-py2.7.egg/tox/__init__.pyc
py33 recreate: /Users/dwt/Code/Projekte/pyexpect/.tox/py33
  /Users/dwt/Code/Projekte/pyexpect/.tox$ /usr/bin/python -mvirtualenv --setuptools --python /Users/dwt/Library/Homebrew/bin/python3.3 py33 >/Users/dwt/Code/Projekte/pyexpect/.tox/py33/log/py33-0.log
py33 develop-inst: /Users/dwt/Code/Projekte/pyexpect
  /Users/dwt/Code/Projekte/pyexpect$ /Users/dwt/Code/Projekte/pyexpect/.tox/py33/bin/pip install --pre -e /Users/dwt/Code/Projekte/pyexpect >/Users/dwt/Code/Projekte/pyexpect/.tox/py33/log/py33-1.log
py33 runtests: PYTHONHASHSEED='1252960215'
py33 runtests: commands[0] | /Users/dwt/Code/Projekte/pyexpect/.tox/py33/bin/python pyexpect.py
  /Users/dwt/Code/Projekte/pyexpect$ /Users/dwt/Code/Projekte/pyexpect/.tox/py33/bin/python pyexpect.py 
..................................
----------------------------------------------------------------------
Ran 34 tests in 0.272s

OK
___________ summary ____________
  py33: commands succeeded
  congratulations :)

My tox file specifies this variable:

[tox]
envlist = py26, py27, py33
#, pypy

[testenv]
commands = {envpython} pyexpect.py

[testenv:py33]
setenv =
    PYTHONPATH = 

So it seems tox is missing to actually hand in that virtualenv variable to the python 3.3 in question.

Comments (7)

  1. Simon Lundmark

    Got the same issue with Python 3.4. It seems to try to use the 2.5 interpreter but crashes. I'm on Mac Mavericks and Python 3.4 was installed via Homebrew. Very weird since it worked yesterday without a problem on 3.4... No clue on what changed today.

    $ python --version
    Python 2.7.6
    $ python3.4 --version
    Python 3.4.0
    $  tox --version
    1.7.1 imported from /usr/local/lib/python2.7/site-packages/tox/__init__.pyc
    
  2. Daniel Hahler

    Any chance that you are using pyenv?

    I am using pyenv, and the problem is that python3.3 is available (as a shim), but executing it results in an error:

    pyenv: python3.3: command not found

    The `python3.3' command exists in these Python versions: 3.3.5

    % pyenv shell 3.4.1
    % tox -v -e py33-1.7.x
    py33-1.7.x create: venv/src/django-taggit/.tox/py33-1.7.x
    > /home/user/.pyenv/versions/3.4.1/lib/python3.4/site-packages/tox/_config.py(190)getsupportedinterpreter()
        189         import ipdb; ipdb.set_trace()
    --> 190         if info.version_info < (2,6):
        191             raise tox.exception.UnsupportedInterpreter(
    
    ipdb> l
        185                 "Jython/Windows does not support installing scripts")
        186         info = self.config.interpreters.get_info(self.basepython)
        187         if not info.executable:
        188             raise tox.exception.InterpreterNotFound(self.basepython)
        189         import ipdb; ipdb.set_trace()
    --> 190         if info.version_info < (2,6):
        191             raise tox.exception.UnsupportedInterpreter(
        192                 "python2.5 is not supported anymore, sorry")
        193         return info.executable
        194
        195 testenvprefix = "testenv:"
    
    ipdb> info.
    info.err           info.executable    info.name          info.out           info.runnable      info.version_info
    ipdb> info.executable
    local('/home/user/.pyenv/shims/python3.3')
    ipdb> info.version_info
    ipdb> info.runnable
    False
    ipdb> info.out
    b''
    ipdb> info.err
    b"pyenv: python3.3: command not found\n\nThe `python3.3' command exists in these Python versions:\n  3.3.5\n\n"
    

    This then results in the following error, because info.version_info is None:

    /home/user/.pyenv/versions/3.4.1/lib/python3.4/site-packages/tox/_venv.py in getsupportedinterpreter(self)
        169
        170     def getsupportedinterpreter(self):
    --> 171         return self.envconfig.getsupportedinterpreter()
        172
        173     def create(self, action=None):
    
    /home/user/.pyenv/versions/3.4.1/lib/python3.4/site-packages/tox/_config.py in getsupportedinterpreter(self)
        188             raise tox.exception.InterpreterNotFound(self.basepython)
        189         import ipdb; ipdb.set_trace()
    --> 190         if info.version_info < (2,6):
        191             raise tox.exception.UnsupportedInterpreter(
        192                 "python2.5 is not supported anymore, sorry")
    
      TypeError: unorderable types: NoneType() < tuple()
    

    I could imagine that pytest could also raise InterpreterNotFound if the version information is None.

  3. chris-martin

    My anecdote, in case anyone else faces the same problem: I saw this error on CircleCI because only one python version is installed by default. Using pyenv to install the other required ones (e.g. pyenv global 3.3.2) fixed it.

  4. Log in to comment