× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [64 lines of output]
C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\dist.py:491: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
code
Assistant
********************************************************************************
Usage of dash-separated 'description-file' will not be supported in future
versions. Please use the underscore name 'description_file' instead.
By 2025-Mar-03, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
opt = self.warn_dash_deprecation(opt, section)
running egg_info
creating C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info
writing C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info\PKG-INFO
writing dependency_links to C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info\dependency_links.txt
writing requirements to C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info\requires.txt
writing top-level names to C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info\top_level.txt
writing manifest file 'C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info\SOURCES.txt'
reading manifest file 'C:\Users\engli\AppData\Local\Temp\pip-pip-egg-info-8d3fs95c\pyspark.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.py[cod]' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\engli\AppData\Local\Temp\pip-install-oiu2nsoa\pyspark_96440a4a4e0f46fd9685c2737b87623d\setup.py", line 225, in <module>
setup(
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\core.py", line 183, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands
dist.run_commands()
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
self.run_command(cmd)
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\dist.py", line 991, in run_command
super().run_command(command)
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
cmd_obj.run()
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\command\egg_info.py", line 315, in run
self.find_sources()
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\command\egg_info.py", line 323, in find_sources
mm.run()
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\command\egg_info.py", line 549, in run
self.prune_file_list()
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\command\sdist.py", line 161, in prune_file_list
super().prune_file_list()
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 380, in prune_file_list
base_dir = self.distribution.get_fullname()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_core_metadata.py", line 267, in get_fullname
return _distribution_fullname(self.get_name(), self.get_version())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\engli\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_core_metadata.py", line 285, in _distribution_fullname
canonicalize_version(version, strip_trailing_zero=False),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
It looks like you're encountering an error while trying to install pyspark using pip. The error message indicates a TypeError related to the canonicalize_version() function, specifically mentioning an unexpected keyword argument 'strip_trailing_zero'.
This issue is likely due to a mismatch between versions of the setuptools and packaging libraries. The setuptools package is trying to use a feature (strip_trailing_zero keyword argument) that is not available in the version of the packaging library you have installed.
Here's how you can resolve this issue:
Upgrade pip, setuptools, and packaging to the latest versions:
Open your command prompt or terminal and run the following commands:
The setuptools library is responsible for building and installing Python packages. It relies on the packaging library for various packaging utilities.
In the error message, setuptools is attempting to call canonicalize_version() with an argument strip_trailing_zero, but the installed version of packaging doesn't accept this argument.
Updating both setuptools and packaging ensures that these two libraries are compatible. The newer versions of packaging include support for the strip_trailing_zero argument.
Additional Notes:
The warnings about the deprecated description-file option are just warnings and shouldn't cause the installation to fail. However, keeping all packages updated is good practice.
The notices about a new pip version suggest that you can benefit from features and bug fixes included in the latest version.
Summary:
By upgrading pip, setuptools, and packaging, you should resolve the compatibility issue that's causing the TypeError. After performing the upgrades, reinstalling pyspark should proceed without errors.