Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.10: ModuleNotFoundError: No module named 'distutils.command.bdist_wininst' #2558

Closed
hroncok opened this issue Feb 4, 2021 · 7 comments · Fixed by #2566
Closed
Labels
bug help wanted Needs Implementation Issues that are ready to be implemented. Needs Investigation Issues which are likely in scope but need investigation to figure out the cause

Comments

@hroncok
Copy link
Contributor

hroncok commented Feb 4, 2021

Hello. With Python 3.10.0a5+ we have this problem when running setuptools tests in Fedora:

==================================== ERRORS ====================================
_____________ ERROR collecting setuptools/command/bdist_wininst.py _____________
setuptools/command/bdist_wininst.py:1: in <module>
    import distutils.command.bdist_wininst as orig
E   ModuleNotFoundError: No module named 'distutils.command.bdist_wininst'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 2 skipped, 1 error in 1.41s ==========================

The bdist_wininst command deprecated in Python 3.8 has been removed. The bdist_wheel command is now recommended to distribute binary packages on Windows. (Contributed by @vstinner in bpo-42802.)

https://docs.python.org/3.10/whatsnew/3.10.html#distutils

@webknjaz webknjaz added bug help wanted Needs Implementation Issues that are ready to be implemented. Needs Investigation Issues which are likely in scope but need investigation to figure out the cause labels Feb 4, 2021
@hroncok
Copy link
Contributor Author

hroncok commented Feb 4, 2021

I suppose the import could be try-excepted and the file might do nothing if nothing is there.

Alternatively, the command could be removed from next setuptools version altogether.

@hroncok
Copy link
Contributor Author

hroncok commented Feb 4, 2021

I've tried

rm setuptools/command/bdist_wininst.py setuptools/tests/test_bdist_deprecations.py

But I've been bit by pytest-dev/pytest#8227

@hroncok
Copy link
Contributor Author

hroncok commented Feb 12, 2021

This will be tricky.

The distutils deprecation breaks a lot of tests and integration tests try to use old versions of pip that are not compatible with Python 3.10 due to collections.abc aliases removed from collections.

hroncok added a commit to hroncok/setuptools that referenced this issue Feb 12, 2021
@hroncok
Copy link
Contributor Author

hroncok commented Feb 12, 2021

I've drafted #2566 to solve my most immediate issues. That PR allows use to continue testing with Python 3.10.0a5 until a permanent solution is discussed.

hroncok added a commit to hroncok/setuptools that referenced this issue Feb 12, 2021
@vstinner
Copy link
Contributor

Oh, I expected setuptools to be compatible with bdist_wininst removal, I prepared the removal in setuptools with:

But it seems like I missed this issue.

@jaraco
Copy link
Member

jaraco commented Mar 7, 2021

integration tests try to use old versions of pip that are not compatible with Python 3.10 due to collections.abc aliases removed from collections

This seems like a separate issue that can be worked around by skipping these tests on Python 3.10 for now. Do we know which versions of pip run on Python 3.10?

@jaraco
Copy link
Member

jaraco commented Mar 7, 2021

This seems like a separate issue that can be worked around by skipping these tests on Python 3.10 for now. Do we know which versions of pip run on Python 3.10?

Looks like pip 19.2 fixed the issue and 19.1.1 is the last version with the defect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Needs Implementation Issues that are ready to be implemented. Needs Investigation Issues which are likely in scope but need investigation to figure out the cause
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants