tox doesn't work with older pip versions like 1.4.1

Issue #228 on hold
Marc-Andre Lemburg created an issue

When running bin/tox with pip 1.4.1 (and pyrun) you get:

Could not run 'bin/tox': No module named req_file

Looking into the code, this line is causing it:

lib/python2.7/site-packages/tox/ -- from pip.req.req_file import parse_requirements

The current pip does come with a req_file module. It was added in Jan 2014 and released in version 6.0 of pip.

The of tox does not define a dependency on pip:

I guess it would be good to define the minimum version with which tox works.

Comments (14)

  1. Matthias Bach

    I also ran into this issue. Tox 1.9.1 has a code dependency on pip>=6.0 which is not declared in the package dependencies. Please fix this, as it causes surprising failures and forces us to add unnecessary additional set-up logic to our CI environment.

    Note that this requirement does not exist for tox 1.9.0, which in my opinion violates semantic versioning.

  2. Holger Krekel repo owner

    could some of you try pip install and see if it works within your environments? I think the problem was simply that we need to import from pip.req instead of pip.req.req_file. cc @sontek

  3. Holger Krekel repo owner
    • backout ability that --force-deps substitutes name/versions in requirement files due to various issues.

    • This fixes issue228, fixes issue230, fixes issue231 which popped up with 1.9.1.

    • bump to 1.9.2 version

    → <<cset 452288d6c500>>

  4. Marc-Andre Lemburg reporter

    Doesn't seem to help:

    tmp/test-tox-2> bin/pip install
    tmp/test-tox-2> bin/tox
    Traceback (most recent call last):
      File "bin/tox", line 8, in <module>
        load_entry_point('tox==1.9.2.dev2', 'console_scripts', 'tox')()
    line 318, in load_entry_point
    line 2221, in load_entry_point
    line 1954, in load
      File "/home/lemburg/tmp/test-tox-2/lib/python2.7/site-packages/tox/", line 23, in <module>
        from tox._cmdline import main as cmdline  # noqa
      File "/home/lemburg/tmp/test-tox-2/lib/python2.7/site-packages/tox/", line 15, in <module>
        from tox._venv import VirtualEnv
      File "/home/lemburg/tmp/test-tox-2/lib/python2.7/site-packages/tox/", line 6, in <module>
        from tox._config import DepConfig
      File "/home/lemburg/tmp/test-tox-2/lib/python2.7/site-packages/tox/", line 13, in <module>
        from import PipSession
    ImportError: cannot import name PipSession

    I had pip 1.4.1 installed and would have expected tox to upgrade this to pip 6.0

  5. Cédric Krier

    @malemburg It doesn't seem you are installing the released 1.9.2 version The final fix was not to add a dependency to pip but to backout the new functionality that depended on it.

  6. Marc-Andre Lemburg reporter

    Right, I was testing the version Holger had asked to test. With the released version, everything works fine - even with pip 1.4.1. Thanks.

  7. Log in to comment