Skip to content

UserWarning: Distutils was imported before Setuptools #3650

Closed

Description

@champost

Describe the bug
Encountered a warning when running Renku CLI on Windows Subsystem for Linux (WSL) 2. I was following the instructions laid out for the Renku CLI : https://renku.readthedocs.io/en/latest/how-to-guides/own_machine/cli-installation.html

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
$ python3 --version
Python 3.10.12
$ pipx install renku
installed package renku 2.7.0, installed using Python 3.10.12
These apps are now globally available
	- renku
done!
$ 
$ 
$ renku --version
/home/beeravol/.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/beeravol/.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

Activity

  1. added
    status/triage
    on Nov 6, 2023
  2. added
    status/accepted
    and removed
    status/triage
    on Nov 28, 2023
  3. Panaetius commented on Nov 28, 2023

    @Panaetius
    Member

    i think you just need to update setuptools pip install --upgrade setuptools. unfortunately, pipx keeps its own internal cache of dependencies, so you might need to use pipx runpip ... instead.

    renku itself does no depend on/use setuptools, though some of its dependencies do

  4. champost commented on Nov 28, 2023

    @champost
    Author

    @Panaetius : pip install --upgrade setuptools gives the following output.

    $ pip install --upgrade setuptools
    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (59.6.0)
    Collecting setuptools
      Downloading setuptools-69.0.2-py3-none-any.whl (819 kB)
         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.5/819.5 KB 1.2 MB/s eta 0:00:00
    Installing collected packages: setuptools
    Successfully installed setuptools-69.0.2
    $ 
    $ 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.
    

    If pipx is a recommended way for installing the Renku CLI I think we need to make sure it is a seamless experience for users (at least on a clean install of Linux) and give them all the required information on https://renku.readthedocs.io

  5. moved this from Backlog to Done in renku-pythonon Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugstatus/accepted

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions