upgrade to tox 2.1.1 breaks tox: ImportError: No module named hookspecs

Issue #266 on hold
Sorin Ionuț Sbârnea created an issue

As I was trying to debug anouther issue with tox I tried to upgrade it and I discovered that the new version is broken on OS X.

sudo pip install --upgrade tox
Collecting tox
  Downloading tox-2.1.1-py2.py3-none-any.whl
Collecting virtualenv>=1.11.2 (from tox)
  Downloading virtualenv-13.1.0-py2.py3-none-any.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 272kB/s
Collecting py>=1.4.17 (from tox)
  Downloading py-1.4.30-py2.py3-none-any.whl (81kB)
    100% |████████████████████████████████| 86kB 3.7MB/s
Collecting pluggy<0.4.0,>=0.3.0 (from tox)
  Downloading pluggy-0.3.0-py2.py3-none-any.whl
Installing collected packages: virtualenv, py, pluggy, tox
  Found existing installation: virtualenv 12.0.7
    Uninstalling virtualenv-12.0.7:
      Successfully uninstalled virtualenv-12.0.7
  Found existing installation: py 1.4.26
    Uninstalling py-1.4.26:
      Successfully uninstalled py-1.4.26
  Found existing installation: tox 1.9.2
    Uninstalling tox-1.9.2:
      Successfully uninstalled tox-1.9.2

And the outcome is:

sorins@nibbler  ~/dev/jira $ 1 which tox
/usr/local/bin/toxsorins@nibbler  ~/dev/jira $  toxTraceback (most recent call last):  File "/usr/local/bin/tox", line 7, in <module>    from tox import cmdline  File "/usr/local/lib/python2.7/site-packages/tox/__init__.py", line 4, in <module>
    from .hookspecs import hookspec, hookimpl  # noqa
ImportError: No module named hookspecs
sorins@nibbler  ~/dev/jira $ 1 which python
sorins@nibbler  ~/dev/jira $  python -m tox
/usr/local/opt/python/bin/python2.7: No module named hookspecs; 'tox' is a package and cannot be directly executed

Comments (6)

  1. Sorin Ionuț Sbârnea reporter

    I do have to mention that this does not happen if I install latest tox on python3, only with python2 I get this.

  2. Holger Krekel repo owner

    seems like an unclean install or something. Can you do a new virtualenv and install there to check?

  3. Sorin Ionuț Sbârnea reporter

    I am using tox to start several python versions with their own virtual environments inside, so tox should be outside them. I will try to clean the environment first, but making backups of current files, so we can identify exactly what went wrong and find a way to prevent it in the future. i will be back with results, I will try removing all deps and reinstalling.

  4. Sorin Ionuț Sbârnea reporter

    You may be right as this being probably caused by running sudo pip install .., which endsup with some root owned files that cannot be replaced later. After changing permissions I solve this issue.

    Still, surprisingly now my tests are not running as tox returns quicly on all platform with error. I need to check this as may be related to the new version. I guess I need to read the docs to see if there was something changed in 2.x. Thanks.

  5. Log in to comment