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 breaks with tox: cannot import name 'ensure_text' #1597

Closed
postrational opened this issue Feb 12, 2020 · 1 comment
Closed

Comments

@postrational
Copy link

I'm not sure if this is a virtualenv problem, or a tox problem, but when both are installed I can't use tox to create a testing environment.

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 of the environment where virtualenv is installed into if not using the zipapp
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 of the virtual environment creation with the -vvv --with-traceback flags included
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'
@gaborbernat
Copy link
Contributor

It's pip problem, see tox-dev/tox#1516 (comment)

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants