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

"ValueError: too many values to unpack (expected 2)" when running python3 -m virtualenv xxx -p python3.8 #2163

Closed
Ark-kun opened this issue Aug 6, 2021 · 1 comment · Fixed by #2165
Labels

Comments

@Ark-kun
Copy link

Ark-kun commented Aug 6, 2021

Issue

python3 -m virtualenv xxx -p python3.7  # Fails with "ValueError: too many values to unpack (expected 2)"
python3 -m virtualenv xxx -p python3.8  # Fails with "ValueError: too many values to unpack (expected 2)"
python3 -m virtualenv xxx -p python3.9  # Succeeds

I expect virtualenv not to fail this way.

Environment

Provide at least:

  • OS: Linux
  • pip list of the host python where virtualenv is installed:
$ pip list
Package                           Version
--------------------------------- ----------------------
absl-py                           0.11.0
apparmor                          2.13.6
appdirs                           1.4.4
argcomplete                       1.12.3
astroid                           2.5.6
astunparse                        1.6.3
attrs                             21.2.0
backports.entry-points-selectable 1.1.0
bcrypt                            3.1.7
beautifulsoup4                    4.9.3
black                             21.7b0
blinker                           1.4
Brlapi                            0.8.2
cachetools                        4.2.2
certifi                           2020.6.20
cffi                              1.14.5
chardet                           4.0.0
chrome-gnome-shell                0.0.0
click                             7.1.2
cloudpickle                       1.6.0
colorlog                          5.0.1
crcmod                            1.7
credentialkit-client              1
cryptography                      3.3.2
cupshelpers                       1.0
dbus-python                       1.2.16
Deprecated                        1.2.12
distlib                           0.3.2
distro                            1.5.0
docstring-parser                  0.8.1
duplicity                         0.8.17
fasteners                         0.14.1
filelock                          3.0.12
fire                              0.4.0
flatbuffers                       1.12
future                            0.18.2
gast                              0.4.0
gbulb                             0.6.1
glinux-boot-image-kthresher       1.4.1
glinux-homedir-helper             1
glinux-identity                   1
glinux-welcome                    12
goobuntu-config-tools             0.1
goobuntu-gce-login-policy         0.1
goobuntu-sso-watcher              0.1
google-api-core                   1.29.0
google-api-python-client          1.12.8
google-auth                       1.30.1
google-auth-httplib2              0.1.0
google-auth-oauthlib              0.4.5
google-cloud-aiplatform           1.3.0
google-cloud-bigquery             2.23.2
google-cloud-core                 1.6.0
google-cloud-storage              1.38.0
google-crc32c                     1.1.2
google-pasta                      0.2.0
google-resumable-media            1.3.0
googleapis-common-protos          1.53.0
googlenetworkaccess               0.1
gpg                               1.14.0-unknown
grpcio                            1.39.0
h5py                              3.1.0
hg-evolve                         10.4.0.dev0
html5lib                          1.1
httplib2                          0.18.1
idna                              2.10
iniparse                          0.4
invoke                            1.4.1
IPy                               1.1
isort                             5.8.0
jsonschema                        3.2.0
keras-nightly                     2.5.0.dev2021032900
Keras-Preprocessing               1.1.2
kernel-pruner                     56
kfp                               1.6.2
kfp-pipeline-spec                 0.1.7
kfp-server-api                    1.6.0
kubernetes                        12.0.1
lazy-object-proxy                 1.6.0
LibAppArmor                       2.13.6
lockfile                          0.12.2
louis                             3.16.0
lxml                              4.6.3
lz4                               3.1.3+dfsg
Markdown                          3.3.4
mccabe                            0.6.1
mercurial                         5.8+hg149.df2bf38ac382
monotonic                         1.5
mypy-extensions                   0.4.3
nox                               2021.6.12
numpy                             1.19.5
oauthlib                          3.1.0
obno                              43
olefile                           0.46
onboard                           1.4.1
opt-einsum                        3.3.0
packaging                         20.9
PAM                               0.4.2
paramiko                          2.7.2
pathspec                          0.8.1
pexpect                           4.8.0
Pillow                            8.1.2
pip                               21.2.2
platformdirs                      2.2.0
proto-plus                        1.19.0
protobuf                          3.15.8
psutil                            5.8.0
py                                1.10.0
pyasn1                            0.4.8
pyasn1-modules                    0.2.1
pycairo                           1.16.2
pycparser                         2.20
pycrypto                          2.6.1
pycups                            2.0.1
pycurl                            7.43.0.6
Pygments                          2.7.1
PyGObject                         3.38.0
pyinotify                         0.9.6
PyJWT                             1.7.1
PyKCS11                           1.5.10
pylint                            2.8.3
PyNaCl                            1.4.0
pyOpenSSL                         20.0.1
pyparsing                         2.4.7
pyrsistent                        0.17.3
pysmbc                            1.0.23
python-apt                        2.2.1
python-augeas                     0.5.0
python-dateutil                   2.8.1
python-debian                     0.1.39
python-networkmanager             2.2
python-pam                        1.8.4
python-xapp                       2.0.2
python-xlib                       0.29
pytz                              2021.1
pyudev                            0.22.0
pyxattr                           0.7.2
pyxdg                             0.27
PyYAML                            5.3.1
reboot-enforcer                   0.1
reconfigure                       0.1.81
regex                             2021.3.17
rekey                             1
requests                          2.25.1
requests-oauthlib                 1.3.0
requests-toolbelt                 0.9.1
rsa                               4.7.2
scour                             0.38.2
setproctitle                      1.2.1
setuptools                        52.0.0
six                               1.15.0
soupsieve                         2.2.1
strip-hints                       0.1.9
tabulate                          0.8.9
tensorboard                       2.5.0
tensorboard-data-server           0.6.1
tensorboard-plugin-wit            1.8.0
tensorflow                        2.5.0
tensorflow-estimator              2.5.0
termcolor                         1.1.0
tinycss                           0.4
tinycss2                          1.0.2
toml                              0.10.2
tomli                             1.2.0
typed-ast                         1.4.2
typing-extensions                 3.7.4.3
ufw                               0.36
uritemplate                       3.0.1
urllib3                           1.26.5
virtualenv                        20.7.0
webencodings                      0.5.1
websocket-client                  1.0.1
Werkzeug                          2.0.1
wheel                             0.36.2
wrapt                             1.12.1
xdg                               5
yapf                              0.31.0

Output of the virtual environment creation

Make sure to run the creation with -vvv --with-traceback:

$ /usr/bin/python3 -m virtualenv xxx -p python3.8 -vvv --with-traceback
128 setup logging to NOTSET [DEBUG report:43]
377 find interpreter for spec PythonSpec(implementation=CPython, major=3, minor=8) [INFO builtin:62]
378 proposed PythonInfo(spec=CPython3.9.2.final.0-64, exe=/usr/bin/python3, platform=linux, version='3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [INFO builtin:69]
378 discover PATH[0]=/usr/local/google/home/avolkov/miniconda3/condabin [DEBUG builtin:114]
379 filesystem is case-sensitive [DEBUG info:28]
379 discover PATH[1]=/usr/local/google/home/avolkov/.local/bin [DEBUG builtin:114]
380 discover PATH[2]=/usr/local/google/home/avolkov/.local/bin [DEBUG builtin:114]
380 discover PATH[3]=/usr/lib/google-golang/bin [DEBUG builtin:114]
384 discover PATH[4]=/usr/local/buildtools/java/jdk/bin [DEBUG builtin:114]
384 discover PATH[5]=/usr/local/sbin [DEBUG builtin:114]
385 discover PATH[6]=/usr/local/bin [DEBUG builtin:114]
385 discover PATH[7]=/usr/sbin [DEBUG builtin:114]
385 discover PATH[8]=/usr/bin [DEBUG builtin:114]
386 Attempting to acquire lock 140475749407040 on /usr/local/google/home/avolkov/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG filelock:270]
386 Lock 140475749407040 acquired on /usr/local/google/home/avolkov/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [INFO filelock:274]
387 got python info of /usr/bin/python3.8 from /usr/local/google/home/avolkov/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.json [DEBUG via_disk_folder:135]
388 Attempting to release lock 140475749407040 on /usr/local/google/home/avolkov/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [DEBUG filelock:315]
388 Lock 140475749407040 released on /usr/local/google/home/avolkov/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [INFO filelock:318]
388 proposed PathPythonInfo(spec=CPython3.8.7.final.0-64, exe=/usr/bin/python3.8, platform=linux, version='3.8.7 (default, Dec 22 2020, 10:37:26) \n[GCC 10.2.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:69]
388 accepted PathPythonInfo(spec=CPython3.8.7.final.0-64, exe=/usr/bin/python3.8, platform=linux, version='3.8.7 (default, Dec 22 2020, 10:37:26) \n[GCC 10.2.0]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:71]
433 create virtual environment via CPython3Posix(dest=/usr/local/google/home/avolkov/_projects/python-aiplatform/xxx, clear=False, no_vcs_ignore=False, global=False) [INFO session:52]
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/__main__.py", line 80, in <module>
    run_with_catch()  # pragma: no cov
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/__main__.py", line 65, in run_with_catch
    run(args, options, env)
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/__main__.py", line 18, in run
    session = cli_run(args, options, env)
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/run/__init__.py", line 32, in cli_run
    of_session.run()
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/run/session.py", line 46, in run
    self._create()
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/run/session.py", line 53, in _create
    self.creator.run()
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/create/creator.py", line 171, in run
    self.create()
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/create/via_global_ref/builtin/via_global_self_do.py", line 79, in create
    dirs = self.ensure_directories()
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/create/via_global_ref/builtin/via_global_self_do.py", line 104, in ensure_directories
    return {self.dest, self.bin_dir, self.script_dir, self.stdlib} | set(self.libs)
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/create/describe.py", line 29, in bin_dir
    return self.script_dir
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/create/describe.py", line 33, in script_dir
    return self.dest / self.interpreter.install_path("scripts")
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/discovery/py_info.py", line 125, in install_path
    config_var = {k: "" if v in prefixes else v for k, v in self.sysconfig_vars}
  File "/usr/local/google/home/avolkov/.local/lib/python3.9/site-packages/virtualenv/discovery/py_info.py", line 125, in <dictcomp>
    config_var = {k: "" if v in prefixes else v for k, v in self.sysconfig_vars}
ValueError: too many values to unpack (expected 2)
@gaborbernat
Copy link
Contributor

Fix released via https://pypi.org/project/virtualenv/20.7.1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants