skip to Main Content

Every time I boot up terminal on VSCode, I get the following prompt. This does not happen on Terminal.app.

    /usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34:
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip
and other standards-based tools.

How do I resolve this?

6

Answers


  1. Install the setuptools 58.2.0 version using the following command

    pip install setuptools==58.2.0
    
    Login or Signup to reply.
  2. I assume you stumbled across this issue when you was building your .whl-file doing something like python Setup.py bdist_wheel --dist-dir .. (If not: This answer probably not applies to your problem.)
    The warning you see wants to say that calling python Setup.py ... is obsolete now.

    Solution, in short:

    Replace setup.py with pyproject.toml. In pyproject.toml you enter all values from setup.py in an INI-file-like-structure. Then you create your .whl-file using the command python -m build.

    Further information about python-packages and pyproject.toml: https://packaging.python.org/en/latest/tutorials/packaging-projects/

    Further information about how to use pyproject.toml using setuptools:
    https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

    Login or Signup to reply.
  3. Upgrade the setuptools. The versions greater than 58.2.0 is not showing the deprecation warning as of Oct 18, 2022.

    pip install -U setuptools

    Note, there are many ways to package Python. You will want to evaluate where your target deployment is. Working with the TOML files is a trend that allows better integration with many software languages. Reference: Overview of Packaging for Python

    Login or Signup to reply.
  4. Install the setuptools 58.2.0 version using the following command

    pip install setuptools==58.2.0
    

    Don’t upgrade the setuptools. Only the version 58.2.0 worked for me. Though I tried upgrading the version to 65.5.0 but it was showing the deprecation warning.

    Login or Signup to reply.
  5. I was having same issue for my data science project. I got same error while running pip install -r requirements.txt. This Worked for me.

    Login or Signup to reply.
  6. Calling setup.py directly is being deprecated, as explained here.

    I did as the message told me and now build the wheel using pip (it still calls setup.py internally):

    pip wheel --no-deps -w dist .
    

    This replaced my old equivalent code:

    python setup.py bdist_wheel
    

    Note that the pip wheel command creates the wheel into your current directory by default, which is why I specify -w/--wheel_dir to match the old behavior of using the ./dist directory.

    I also specify --no-deps so pip does not download the wheel files of all dependencies.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search