https://pantsbuild.org/ logo
#general
Title
# general
a

acceptable-guitar-79854

12/26/2020, 2:09 PM
Merry Christmas everyone! In my case, I cannot install pants anymore since the last commit to
./pants
(the virtualenv thingy). I tried prepending
$venv_path/src
to PYTHONPATH but then it complains about
appdirs
Copy code
(pants) cristian@Cristian-XPS13:~/workspace$ ./pants --version
Traceback (most recent call last):
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/__main__.py", line 77, in <module>
    run_with_catch()  # pragma: no cov
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/__main__.py", line 58, in run_with_catch
    from virtualenv.config.cli.parser import VirtualEnvOptions
ModuleNotFoundError: No module named 'virtualenv'
./pants: line 293: /home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py38/bin/python: No such file or directory
Copy code
(pants) cristian@Cristian-XPS13:~/workspace$ ./pants --version
Traceback (most recent call last):
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/__main__.py", line 77, in <module>
    run_with_catch()  # pragma: no cov
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/__main__.py", line 58, in run_with_catch
    from virtualenv.config.cli.parser import VirtualEnvOptions
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/__init__.py", line 3, in <module>
    from .run import cli_run, session_via_cli
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/run/__init__.py", line 6, in <module>
    from ..app_data import make_app_data
  File "/home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/virtualenv-20.2.2/src/virtualenv/app_data/__init__.py", line 9, in <module>
    from appdirs import user_data_dir
ModuleNotFoundError: No module named 'appdirs'
f

fast-nail-55400

12/26/2020, 6:30 PM
Maybe wipe the bootstrap venv and let the script rebuild it? I.e.,
rm -rf /home/cristian/.cache/pants/setup/bootstrap-Linux-x86_64/
I’ve had to do that in the past when that bootstrap venv gets corrupted in some way.
a

acceptable-guitar-79854

12/26/2020, 7:42 PM
i did
rm -rf ~/.cache
several times and it didn't help
f

fast-nail-55400

12/26/2020, 7:46 PM
I reproduced it locally (on macOS) by trying to use that script in the example-python repository.
I’m going to put up a PR to revert it for now. Frankly we should stop using the
virtualenv
package and start using the
venv
module built into Python 3.x
a

acceptable-guitar-79854

12/26/2020, 7:49 PM
thank you
actually in my case that one worked
f

fast-nail-55400

12/26/2020, 7:52 PM
a

acceptable-guitar-79854

12/26/2020, 7:52 PM
the
pants
script in example-python is not the latest version of the script (it is the one before). In my case the script version in example-python worked but the most recent one (with VENV_VERSION=${VENV_VERSION:-20.2.2}) didn't
maybe it would be good to version the pants script altogether
h

happy-kitchen-89482

12/27/2020, 1:13 AM
Thanks for addressing this, @fast-nail-55400!