pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.84k stars 1.03k forks source link

Debian package `python3-virtualenv` breaks `tox` #2557

Closed chrysle closed 1 year ago

chrysle commented 1 year ago

Issue

I had the debian package python3-virtualenv installed (as a dependency to the package tox) and tried to invoke tox in the directory of the cloned source code of virtualenv. However, this failed with an error message:

.tox create: /home/user/repos/virtualenv/.tox/.tox
ERROR: invocation failed (exit code 1), logfile: /home/user/repos/virtualenv/.tox/.tox/log/.tox-0.log
================================================================================= log start ==================================================================================
ModuleNotFoundError: No module named  'virtualenv.seed.via_app_data'

================================================================================== log end ===================================================================================
ERROR: InvocationError for command /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3 .tox (exited with code 1)

I had to remove the tox package and reinstall via pip.

Environment

Provide at least:

Package                       Version              Editable project location
----------------------------- -------------------- ----------------------------
aiohttp                       3.8.3
aiosignal                     1.3.1
aiostream                     0.4.5
alabaster                     0.7.8
appdirs                       1.4.3
apsw                          3.28.0.post1
apturl                        0.5.2
argcomplete                   2.0.0
asgiref                       3.5.2
async-timeout                 4.0.2
atomicwrites                  1.4.1
attrs                         19.3.0
Automat                       22.10.0
Babel                         2.11.0
backports.zoneinfo            0.2.1
bcrypt                        3.1.7
beautifulsoup4                4.8.2
black                         23.1.0
blinker                       1.4
Brlapi                        0.7.0
Brotli                        1.0.7
cachetools                    5.3.0
certifi                       2022.12.7
cffi                          1.15.1
cfgv                          3.3.1
chardet                       5.1.0
charset-normalizer            2.1.1
clear-screen                  0.1.14
click                         8.1.3
click-default-group           1.2.2
click-log                     0.4.0
cloudpickle                   2.2.1
colorama                      0.4.6
colorlog                      6.7.0
command-not-found             0.3
configobj                     5.0.6
console-menu                  0.6.0
constantly                    15.1.0
coverage                      7.2.0
cryptography                  37.0.4
css-parser                    1.0.4
cssselect                     1.1.0
cssutils                      1.0.2
cupshelpers                   1.0
dbus-python                   1.2.16
ddgr                          2.1
decorator                     5.1.1
defer                         1.0.6
devscripts                    2.20.2ubuntu2
distlib                       0.3.6
distro                        1.4.0
distro-info                   0.23ubuntu1
dnspython                     1.16.0
docutils                      0.19
duplicity                     0.8.12.0
entrypoints                   0.3
execnet                       1.9.0
eyeD3                         0.8.10
fasteners                     0.14.1
feedparser                    6.0.2
filelock                      3.12.0
flashtext                     2.7
frozenlist                    1.3.3
furo                          2022.12.7
future                        0.18.2
gnupg                         2.3.1
gpg                           1.13.1-unknown
html2text                     2020.1.16
html5-parser                  0.4.9
html5lib                      1.0.1
httplib2                      0.14.0
hyperlink                     21.0.0
hypothesis                    3.44.21
identify                      2.5.18
idna                          3.4
ifaddr                        0.1.6
imagesize                     1.4.1
importlib-metadata            6.0.0
incremental                   22.10.0
Jinja2                        3.1.2
kazam                         1.4.5
keyring                       18.0.1
language-selector             0.1
launchpadlib                  1.10.13
lazr.restfulclient            0.14.2
lazr.uri                      1.0.3
lockfile                      0.12.2
louis                         3.12.0
lxml                          4.5.0
macaroonbakery                1.3.1
Mako                          1.1.0
Markdown                      3.1.1
markdown-it-py                2.2.0
MarkupSafe                    2.1.2
mdit-py-plugins               0.3.4
mdurl                         0.1.2
mechanize                     0.4.5
monotonic                     1.5
more-itertools                4.2.0
msgpack                       0.6.2
multidict                     6.0.4
mutagen                       1.44.0
mypy                          1.0.1
mypy-extensions               1.0.0
mysqlclient                   1.4.4
myst-parser                   0.18.1
netifaces                     0.10.4
nodeenv                       1.7.0
nose                          1.3.7
nox                           2022.11.21
oauthlib                      3.1.0
olefile                       0.46
openshot-qt                   2.4.3
packaging                     23.0
paramiko                      2.6.0
pathspec                      0.11.0
pdfminer.six                  20220524
pdfplumber                    0.7.1
pexpect                       4.6.0
Pillow                        9.2.0
pip                           23.1.1
pipx                          0.12.3.1
platformdirs                  3.2.0
pluggy                        1.0.0
pre-commit                    3.1.0
pretty-bad-protocol           3.1.1
protobuf                      3.6.1
psutil                        5.9.0
puddletag                     2.0.1
py                            1.8.1
pyasn1                        0.4.8
pyasn1-modules                0.2.1
pycairo                       1.16.2
pychm                         0.8.6
pycparser                     2.21
pycrypto                      2.6.1
pycryptodomex                 3.6.1
pycups                        1.9.73
Pygments                      2.14.0
PyGObject                     3.36.0
PyJWT                         1.7.1
pylast                        4.3.0
pymacaroons                   0.13.0
Pympler                       1.0.1
PyNaCl                        1.3.0
pyotp                         2.6.0
pyparsing                     2.4.6
pyperclip                     1.8.2
pyproject_api                 1.5.1
PyQt5                         5.14.1
PyQtWebEngine                 5.14.0
pyRFC3339                     1.1
pytest                        4.6.9
pytest-forked                 1.6.0
pytest-mypy-plugins           1.3.0
pytest-xdist                  1.34.0
python-apt                    2.0.1+ubuntu0.20.4.1
python-daemon                 2.2.4
python-dateutil               2.7.3
python-debian                 0.1.36ubuntu1
python-ldap                   3.2.0
python-Levenshtein            0.12.0
python-magic                  0.4.16
pytz                          2019.3
pyxattr                       0.6.1
pyxdg                         0.26
PyYAML                        5.3.1
pyzmq                         18.1.1
regex                         2019.8.19
reportlab                     3.5.34
repoze.lru                    0.7
requests                      2.28.1
requests-toolbelt             0.10.1
requests-unixsocket           0.2.0
roman                         2.0.0
Routes                        2.4.1
rsa                           4.8
screen-resolution-extra       0.0.0
SecretStorage                 2.3.1
setuptools                    67.3.1
sgmllib3k                     1.0.0
simplejson                    3.16.0
sip                           4.19.21
six                           1.14.0
snowballstemmer               2.2.0
soupsieve                     1.9.5
Sphinx                        6.1.3
sphinx-basic-ng               1.0.0b1
sphinx-notfound-page          0.8.3
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
sphinxcontrib-towncrier       0.3.2a0
sqlparse                      0.4.3
ssh-import-id                 5.10
stdiomask                     0.0.6
systemd-python                234
toml                          0.10.0
tomli                         2.0.1
towncrier                     22.12.1.dev0         /home/kilian/repos/towncrier
tox                           4.4.12
tqdm                          4.61.0
Twisted                       22.10.0
typed-ast                     1.4.1
typing_extensions             4.4.0
ubuntu-advantage-tools        8001
ubuntu-drivers-common         0.0.0
ufw                           0.36
unattended-upgrades           0.1
unidiff                       0.5.5
urllib3                       1.26.13
usb-creator                   0.3.7
userpath                      1.8.0
vboxapi                       1.0
vdirsyncer                    0.19.0
virtualenv                    20.22.0
wadllib                       1.3.3
Wand                          0.6.7
wcwidth                       0.1.8
webencodings                  0.5.1
WebOb                         1.8.5
websockets                    8.1
wheel                         0.38.4
wifite                        2.5.2
xkit                          0.0.0
yarl                          1.8.2
yt-dlp                        2023.3.4
zeroc-ice                     3.7.8
zeroconf                      0.24.4
zipp                          1.0.0
zope.interface                5.5.2
gaborbernat commented 1 year ago

This is a Debian downstream issue, and that's not us.

chrysle commented 1 year ago

Just wondering: If it's Debian, and the issue can't be fixed, why shouldn't the docs contain a warning?

gaborbernat commented 1 year ago

Because ideally should be a Debian issue and documentation 🤔

PS. Debian is horrible for Python development 🤷

gaborbernat commented 1 year ago

Note we encourage users to install this tool via pipx or in a venv, so if you run issue you're already not following our documentation 🤔 so you're in a unsupported world.

gaborbernat commented 1 year ago

See https://virtualenv.pypa.io/en/latest/installation.html#via-pip

Alternatively you can install it within the global Python interpreter itself (perhaps as a user package via the --user flag). Be cautious if you are using a python install that is managed by your operating system or another package manager. pip might not coordinate with those tools, and may leave your system in an inconsistent state.

Is what you're running into.

chrysle commented 1 year ago

PS. Debian is horrible for Python development

Note that I'm using Ubuntu ;-)

Note we encourage users to install this tool via pipx or in a venv, so if you run issue you're already not following our documentation thinking so you're in a unsupported world.

Yes, maybe you're right.

gaborbernat commented 1 year ago

Note that I'm using Ubuntu ;-)

Which is a Debian derivative so is the same 😊