pytest: Travis CI currently broken on some Python 3.5 environments

Affects all py35-* environments, py35 works fine. So every tox environment which sets basepython = python3.5.

Example failure:

ERROR: Error creating virtualenv. Note that some special characters (e.g. ':' and unicode symbols) in paths are not supported by virtualenv. Error details: InvocationError('Failed to get version_info for python3.5: b"pyenv: python3.5: command not found\\n\\nThe `python3.5\' command exists in these Python versions:\\n  3.5\\n  3.5.3\\n\\n"',)

Extracting the string literal from the message:

pyenv: python3.5: command not found

The `python3.5' command exists in these Python versions:
  3.5
  3.5.3

Which is the same error reported in travis-ci/travis-ci#8363.

Already tried this workaround but it failed with an strange problem:

$ pyenv global system 3.5
install
2.56s$ pip install --upgrade --pre tox
Collecting tox
  Downloading tox-2.8.2-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 5.5MB/s 
Collecting virtualenv>=1.11.2; python_version != "3.2" (from tox)
  Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
    100% |████████████████████████████████| 1.8MB 898kB/s 
Collecting pluggy<1.0,>=0.3.0 (from tox)
  Downloading pluggy-0.5.2.tar.gz
Requirement already up-to-date: py>=1.4.17 in /home/travis/virtualenv/python3.6.2/lib/python3.6/site-packages (from tox)
Building wheels for collected packages: pluggy
  Running setup.py bdist_wheel for pluggy ... done
  Stored in directory: /home/travis/.cache/pip/wheels/22/b2/db/618ae8dcba2994fb9ebce70ec1c1ab4923df89a77edac7e901
Successfully built pluggy
Installing collected packages: virtualenv, pluggy, tox
Successfully installed pluggy-0.5.2 tox-2.8.2 virtualenv-15.1.0
14.06s$ tox --recreate
GLOB sdist-make: /home/travis/build/nicoddemus/pytest/setup.py
py34 create: /home/travis/build/nicoddemus/pytest/.tox/py34
py34 installdeps: hypothesis>=3.5.2, nose, mock, requests
py34 inst: /home/travis/build/nicoddemus/pytest/.tox/dist/pytest-0.1.dev289+g072f256.zip
py34 installed: certifi==2017.7.27.1,chardet==3.0.4,hypothesis==3.27.0,idna==2.6,mock==2.0.0,nose==1.3.7,pbr==3.1.1,py==1.4.34,pytest==0.1.dev289+g072f256,requests==2.18.4,six==1.10.0,urllib3==1.22
py34 runtests: PYTHONHASHSEED='3527525262'
py34 runtests: commands[0] | pytest --lsof -rfsxX testing
ERROR: /home/travis/build/nicoddemus/pytest/tox.ini:194: requires pytest-2.0, actual pytest-0.1.dev289+g072f256'
ERROR: InvocationError: '/home/travis/build/nicoddemus/pytest/.tox/py34/bin/pytest --lsof -rfsxX testing'

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

See https://github.com/travis-ci/travis-ci/issues/4990#issuecomment-334388582 and https://github.com/travis-ci/travis-ci/issues/8363#issuecomment-332666189 for related follow-ups.

The fix we applied in the behave-django project for that looks like this:

python: 3.6
...
before_install:
  # work around https://github.com/travis-ci/travis-ci/issues/8363
  - pyenv global system 3.5
...

Hope that helps. This is clearly a Travis image issue. They have to set up pyenv correctly.

For everyone landing here and looking for a solution to the Python/Travis issue:

I recommend switching to tox-travis and the native Travis build matrix capabilities. That does away with all the ugly workarounds.

See django-apptemplates for an implementation example (with an extensive build matrix and build stages).

@ysolovyov Does this reflect a problem re “Travis CI currently broken on some Python 3.5 environments”? I’m not sure. (What if you simply use pip for installing? What if you omit the --user option?)

@ssbarnea I’m not sure:

Setting environment variables from .travis.yml
$ export TOXENV=python3.6

This should be TOXENV=py36 no?

Fixed by #2785