Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualenv 20.0.0 breaks tox #1516

Closed
yelsherbini opened this issue Feb 10, 2020 · 9 comments · Fixed by #1522
Closed

Virtualenv 20.0.0 breaks tox #1516

yelsherbini opened this issue Feb 10, 2020 · 9 comments · Fixed by #1522
Labels
bug:normal affects many people or has quite an impact

Comments

@yelsherbini
Copy link

While updating dependencies virtualenv got updated to version 20.0.0. After the update running tox returns the following error

ROR: invocation failed (exit code 1), logfile: /Users/***/Documents/playground/tox_test/.tox/python/log/python-0.log
==================================================================================== log start =====================================================================================
RuntimeError: failed to query /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/python with code 8 err: 'Exec format error'

===================================================================================== log end ======================================================================================
ERROR: InvocationError for command /Users/***/.virtualenvs/test_tox_virtualenv/bin/python3.7 -m virtualenv --no-download --python /Users/***/.virtualenvs/test_tox_virtualenv/bin/python3.7 python (exited with code 1)
_____________________________________________________________________________________ summary ______________________________________________________________________________________
ERROR:   python: InvocationError for command /Users/***/.virtualenvs/test_tox_virtualenv/bin/python3.7 -m virtualenv --no-download --python /Users/***/.virtualenvs/test_tox_virtualenv/bin/python3.7 python (exited with code 1)

To reproduce:

pip install tox
echo '[tox]\nskipsdist = true' > tox.ini
tox
@yelsherbini yelsherbini added the bug:normal affects many people or has quite an impact label Feb 10, 2020
@gaborbernat
Copy link
Member

This is upstream bug pypa/virtualenv#1545, please report the requested information there.

@yelsherbini
Copy link
Author

But until it is fixed on virtualenv's side, wouldn't it be better to freeze the dependency to virtualenv 16? Currently any fresh new install or dependency update of tox will be broken.

@gaborbernat
Copy link
Member

It's likely virtualenv will fix this before tox release gets out.

@gaborbernat
Copy link
Member

@yelsherbini can you please provide the requested information? How did you install tox?

@smitt04
Copy link

smitt04 commented Feb 10, 2020

This shouldn't be closed as this is a current problem. If you just run pip install tox this is an issue as it installs the latest version of virtualenv which has the bug.

@gaborbernat gaborbernat reopened this Feb 10, 2020
@gaborbernat
Copy link
Member

@smitt04 if you want to help please provide information on pypa/virtualenv#1545

PS. We can leave this open, but the actionable item, for now, is on the virtualenv side.

@smitt04
Copy link

smitt04 commented Feb 10, 2020

I understand it is an issue in virtualenv but as a workaround, you can pin virtualenv in your requirements.txt

virtualenv==16.0.0

@javierpena
Copy link

Would it be possible to update tox's requirement for six to match the version required by virtualenv 20 (>= 1.12.0)?

It could be argued that it's not strictly needed by tox, but pip does not properly handle the transitive dependency (pypa/pip#988), so we are in a catch-22 situation until either side provides a fix.

ovv added a commit to pyslackers/website that referenced this issue Feb 11, 2020
ovv added a commit to pyslackers/website that referenced this issue Feb 11, 2020
mattrasband pushed a commit to pyslackers/website that referenced this issue Feb 11, 2020
* Pin virtualenv to v16

tox-dev/tox#1516

* Add --rm to docker run commands

* Pylint: check unused import in __init__.py files
williamFalcon pushed a commit to Lightning-AI/pytorch-lightning that referenced this issue Feb 12, 2020
@postrational
Copy link

postrational commented Feb 12, 2020

When running tox I'm getting the following error:

  File "/usr/local/lib/python3.6/dist-packages/virtualenv/util/path/_sync.py", line 7, in <module>
    from six import PY2, PY3, ensure_text
ImportError: cannot import name 'ensure_text'
Minimal reproducible example

Builld the following Dockerfile:

FROM ubuntu:18.04

RUN apt-get update

RUN apt-get install -y \
  python3 \
  python3-pip \
  python3-dev

RUN pip3 install -U pip
RUN pip3 install -U tox
RUN pip list
# The following is a command tox would normally call:
RUN /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3 .package
pip list
Package             Version
------------------- -------
appdirs             1.4.3
asn1crypto          0.24.0
cryptography        2.1.4
distlib             0.3.0
filelock            3.0.12
idna                2.6
importlib-metadata  1.5.0
importlib-resources 1.0.2
keyring             10.6.0
keyrings.alt        3.0
packaging           20.1
pip                 20.0.2
pluggy              0.13.1
py                  1.8.1
pycrypto            2.6.1
pygobject           3.26.1
pyparsing           2.4.6
pyxdg               0.25
SecretStorage       2.3.1
setuptools          39.0.1
six                 1.11.0
toml                0.10.0
tox                 3.14.3
virtualenv          20.0.3
wheel               0.30.0
zipp                2.2.0
Output
Step 7/7 : RUN /usr/bin/python3 -m virtualenv -vvv --with-traceback --no-download --python /usr/bin/python3 .package
 ---> Running in e03940f2d861
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/__init__.py", line 3, in <module>
    from .run import cli_run
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/run/__init__.py", line 5, in <module>
    from ..config.cli.parser import VirtualEnvConfigParser
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/config/cli/parser.py", line 6, in <module>
    from ..ini import IniConfig
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/config/ini.py", line 8, in <module>
    from virtualenv.dirs import default_config_dir
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/dirs.py", line 5, in <module>
    from virtualenv.util.lock import ReentrantFileLock
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/util/lock.py", line 11, in <module>
    from virtualenv.util.path import Path
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/util/path/__init__.py", line 5, in <module>
    from ._sync import copy, copytree, ensure_dir, link, symlink
  File "/usr/local/lib/python3.6/dist-packages/virtualenv/util/path/_sync.py", line 7, in <module>
    from six import PY2, PY3, ensure_text
ImportError: cannot import name 'ensure_text'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug:normal affects many people or has quite an impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants