Hello,
I reported a warning (see below) thrown by the Renku CLI while working on WSL for Windows : UserWarning: Distutils was imported before Setuptools · Issue #3650 · SwissDataScienceCenter/renku-python · GitHub
I can now confirm that it also shows up on Linux Mint 21.2 but I am not sure whether I have reported this correctly…
$ renku --version
/home/champost/.local/pipx/shared/lib/python3.10/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/home/champost/.local/pipx/shared/lib/python3.10/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
2.7.0
$
Thanks
Thank you @champost for reporting this warning.
Hey @champost, I just got fed up with this enough myself to resort to extreme measures
Based on internet searches, this should be moot in recent versions of setuptools. So I simply deleted the _distutils_hack
and distutils-precedence.pth
from the site-packages
directory. So far so good, though ymmv! My best guess is that those are left behind from some older version of setuptools and are not removed when setuptools is updated.
Thanks for the heads up @rrrrrok. Looks like MMDV (My Mileage Does Vary) !
$ rm -rf /home/champost/.local/lib/python3.10/site-packages/distutils-precedence.pth /home/champost/.local/lib/python3.10/site-packages/_distutils_hack/*
$ renku session ls
/home/champost/.local/pipx/shared/lib/python3.10/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/home/champost/.local/pipx/shared/lib/python3.10/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Warning: Cannot get sessions list from 'renkulab': Please run the renku login command to authenticate with Renku.
Hi @rrrrrok ,
I ran pip install --upgrade setuptools
as mentioned here : UserWarning: Distutils was imported before Setuptools · Issue #3650 · SwissDataScienceCenter/renku-python · GitHub and now I am a little lost as to what should be my next step…
Would it be possible to update the CLI installation problems section on https://renku.readthedocs.io ? I can then try afresh on a *nix system and see whether I can reproduce warning or not.
Thanks !
As mentioned in the issue you linked, pipx
has its own installation of libraries. So a simple pip install
will not upgrade those libraries. You should do ~/.local/pipx/shared/bin/pip install -U setuptools
. Afterwards make sure you also remove the no longer needed ~/.local/lib/.../site-packages/_distutils_hack
and ~/.local/lib/.../site-packages/distutils-precedence.pth