When I run the below command to build my package
python3 -m build
Creating virtualenv isolated environment...
Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
Getting build dependencies for sdist...
I am getting this error:
Traceback (most recent call last):
File "<string>", line 17, in <module>
ModuleNotFoundError: No module named 'pip._internal.download'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ciasto/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/ciasto/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/ciasto/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 287, in get_requires_for_build_sdist
return hook(config_settings)
File "/tmp/build-env-h_1fvjgg/lib/python3.10/site-packages/setuptools/build_meta.py", line 328, in get_requires_for_build_sdist
return self._get_build_requires(config_settings, requirements=[])
File "/tmp/build-env-h_1fvjgg/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/tmp/build-env-h_1fvjgg/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/tmp/build-env-h_1fvjgg/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 19, in <module>
ModuleNotFoundError: No module named 'pip.download'
ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist
I am using pip version 23.3.1
pip -V
pip 23.3.1 from /home/ciasto/.local/lib/python3.10/site-packages/pip (python 3.10)
and python 3.10
setuptools is 59.6.0
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools
<module 'setuptools' from '/usr/lib/python3/dist-packages/setuptools/__init__.py'>
>>> setuptools.__version__
'59.6.0'
obviously, I want to know how can I fix this issue but I also want to tie the compatible version so that I do not fall into this issue again. ultimately I want to publish package to PyPi