# Deprecate bdist\_wininst

**URL:** <https://discuss.python.org/t/deprecate-bdist-wininst/1929>\
**Category:** Packaging\
**Created:** [July 1, 2019, 11:10am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929 "2019-07-01T11:10:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [July 1, 2019, 11:10am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/1 "2019-07-01T11:10:06Z")

</div>

Hi,

bdist\_wininst uses the mbcs encoding which is only available on Windows. There is an issue open for 8 years to suggest to use UTF-8 or use the Unicode (wide character) flavor of the Windows API to support running bdist\_wininst on non-Windows platforms and to be able to distribute binaries which don’t depend on the ANSI code page: [https://bugs.python.org/issue10945](https://bugs.python.org/issue10945)

When I look at numpy or Cython: they don’t distribute .exe installers, but binary wheel packages for Windows. I understood the wheel packages is the recommended way to distribute binaries on Windows, and so that bdist\_wininst is kind of deprecated.

Does anyone still use bdist\_wininst?

Can we start to deprecate bdist\_wininst in Python 3.9, and maybe remove it later? The removal can be discussed later.

I would simply suggest to not use bdist\_wininst because of its implementation issues, but also because it’s annoying to have to run a GUI to install something, whereas pip can install dependencies in a CLI transparently without buggy the user with dialog boxes.

---

<div class="post-metadata">

**Author:** ![uranusjr](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/uranusjr/32/103_2.png) [@uranusjr](https://discuss.python.org/u/uranusjr)\
**Post date:** [July 1, 2019, 11:24am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/2 "2019-07-01T11:24:00Z")

</div>

> [@vstinner](#):
>
> Does anyone still use bdist\_wininst?

Maybe in some closed-door enterprise systems that don’t change because it has been working, but nothing public as far as I am aware of. [Archived: Python Extension Packages for Windows - Christoph Gohlke](https://www.lfd.uci.edu/~gohlke/pythonlibs/) was a holdout at a time, but it has switched to distribute wheels for a while now.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [July 1, 2019, 12:45pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/3 "2019-07-01T12:45:37Z")

</div>

See also [https://bugs.python.org/issue37468](https://bugs.python.org/issue37468) : “Don’t install wininst\*.exe on non-Windows platforms”.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [July 1, 2019, 12:49pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/4 "2019-07-01T12:49:58Z")

</div>

October 2018, there was a discussion about the license of these files:  
[https://mail.python.org/pipermail/python-dev/2018-October/155507.html](https://mail.python.org/pipermail/python-dev/2018-October/155507.html)

It was requested to not install these files on non-Windows platforms, but nothing was done. I created [https://bugs.python.org/issue37468](https://bugs.python.org/issue37468) to make this change.

---

<div class="post-metadata">

**Author:** ![dstufft](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dstufft/32/23_2.png) [@dstufft](https://discuss.python.org/u/dstufft)\
**Post date:** [July 1, 2019, 4:41pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/5 "2019-07-01T16:41:12Z")

</div>

For what it’s worth, PyPI doesn’t even allow you to upload bdist\_wininst (See [PEP 527](https://www.python.org/dev/peps/pep-0527/)) anymore, so if you’re looking at PyPI to determine usage, you’re going to get no usage whatsoever for anything recent.

I don’t have any idea if other people are still using bdist\_wininst and distributing them through some other mechanism.

---

<div class="post-metadata">

**Author:** ![pganssle](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pganssle/32/245_2.png) [@pganssle](https://discuss.python.org/u/pganssle)\
**Post date:** [July 1, 2019, 6:49pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/6 "2019-07-01T18:49:50Z")

</div>

From my perspective, nearly all _direct_ invocations of `setup.py` are currently or are eventually heading for deprecation. PEP 517 doesn’t provide hooks to generate anything other than `sdist` or `wheel`, so basically all commands not actually triggered (directly or indirectly) by calling a PEP 517 front-end are suspect.

I have occasionally mused about the possibility of a “generic front-end” that would allow people to continue using the `distutils` command structure, but in an environment that allows them to declare their dependencies before invocation, but so far I think `tox` may be the closest thing to that.

Assuming we keep supporting some form of `distutils` commands, I think it would make sense to spin out some of the existing standard library commands into their own modules (e.g. `bdist_rpm`, `bdist_wininst`, probably others I’m not even familiar with), if anyone wants to use and maintain them.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [July 2, 2019, 11:19am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/7 "2019-07-02T11:19:50Z")

</div>

Ok. I created [https://bugs.python.org/issue37481](https://bugs.python.org/issue37481) and [https://github.com/python/cpython/pull/14553](https://github.com/python/cpython/pull/14553) to deprecate bdist\_wininst in Python 3.9.

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [July 2, 2019, 4:13pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/8 "2019-07-02T16:13:39Z")

</div>

> [@pganssle](#):
>
> Assuming we keep supporting some form of `distutils` commands, I think it would make sense to spin out some of the existing standard library commands into their own modules (e.g. `bdist_rpm` , `bdist_wininst` , probably others I’m not even familiar with), if anyone wants to use and maintain them.

There are multiple projects to build any Python package into a RPM. We discussed that with my team at Red Hat, and in short, these projects are mostly useless, especially if the goal is to a package accepted in a Linux distribution. None of these tools respect the guidelines of each distribution. Example of Fedora: [Fedora Packaging Guidelines :: Fedora Docs](https://docs.fedoraproject.org/en-US/packaging-guidelines/)

bdist\_rpm falls into the same category, and it does not seem to be maintained anymore. For example, it requires to pass a “–fix-python” parameter to produce a “correct” package. There is a bug open for 11 years: [Issue 4459: bdist\_rpm should enable --fix-python by default - Python tracker](https://bugs.python.org/issue4459) Éric Araujo wrote "FYI, this is fixed in the new bdist\_rpm2 command: [https://bitbucket.org/tarek/pypi2rpm/changeset/ce6626df0225](https://bitbucket.org/tarek/pypi2rpm/changeset/ce6626df0225) " but [https://bitbucket.org/tarek/pypi2rpm](https://bitbucket.org/tarek/pypi2rpm) also seems to be unmaintained: latest commit 7 years ago.

So if you ask me my opinion, bdist\_rpm should be deprecated/removed as well. But it doesn’t seem to cause much harm, so maybe it’s okish to keep it unmaintained?

---

<div class="post-metadata">

**Author:** ![vstinner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vstinner/32/15130_2.png) [@vstinner](https://discuss.python.org/u/vstinner)\
**Post date:** [July 5, 2019, 9:22am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/9 "2019-07-05T09:22:29Z")

</div>

Ok, I merged my [https://github.com/python/cpython/pull/14553](https://github.com/python/cpython/pull/14553) PR: use bdist\_wininst now emits a DeprecationgWarning, and the command is deprecated in the doc.

Now the question is if someone here wants to go further is deprecate all distutils commands except sdist and bdist\_wheel? Steve Dower wants to deprecate bdist\_msi as well: I’m not sure who use bdist\_msi. It’s another form of GUI installer, so it’s similar to bdist\_wininst. I would also strongly encourage to use bdist\_wheel rather than bdist\_msi.

In [https://github.com/python/cpython/pull/14553](https://github.com/python/cpython/pull/14553) I also had a discussion about [https://docs.python.org/dev/distutils/](https://docs.python.org/dev/distutils/) which is clearly outdated: the doc which starts with “from **distutils.core** import setup” and then advices to use “python setup.py bdist\_wininst”. I suggested to **remove** the doc, but Paul says that setuptools doc expect that readers already read distutils doc, so outdated distutils should be kept.

Would it be possible to create a grant to pay someone to update the distutils doc? With having in mind that distutils code will be moved into setuptools in the long term. So maybe copy distutils doc into setuptools doc, and then rewrite it to replace distutils with setuptools? Or even pay someone to move distutils into setuptools?

Who manage PSF packaging grants?

---

<div class="post-metadata">

**Author:** ![brettcannon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/32/34895_2.png) [@brettcannon](https://discuss.python.org/u/brettcannon)\
**Post date:** [July 5, 2019, 6:11pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/10 "2019-07-05T18:11:16Z")

</div>

> [@vstinner](#):
>
> Now the question is if someone here wants to go further is deprecate all distutils commands except sdist and bdist\_wheel?

Probably a good idea, but I personally don’t have the time.

> [@vstinner](#):
>
> Who manage PSF packaging grants?

The [PSF grants WG](https://wiki.python.org/psf/GrantsWG).

---

<div class="post-metadata">

**Author:** ![pradyunsg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pradyunsg/32/206_2.png) [@pradyunsg](https://discuss.python.org/u/pradyunsg)\
**Post date:** [July 6, 2019, 1:43am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/11 "2019-07-06T01:43:01Z")

</div>

/cc @sumanah, who is maintaining [https://wiki.python.org/psf/Fundable%20Packaging%20Improvements](https://wiki.python.org/psf/Fundable%20Packaging%20Improvements). The distutils-to-setuptools API moving work is already listed there.

---

<div class="post-metadata">

**Author:** ![cgohlke](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cgohlke/32/1159_2.png) [@cgohlke](https://discuss.python.org/u/cgohlke)\
**Post date:** [July 8, 2019, 8:48pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/12 "2019-07-08T20:48:33Z")

</div>

> [@dstufft](#):
>
> PyPI doesn’t even allow you to upload bdist\_wininst (See [PEP 527](https://www.python.org/dev/peps/pep-0527/)) anymore

Maybe a bug: [Pillow](https://pypi.org/project/Pillow/#files) still uploads `bdist_wininst` installers for Windows.

---

<div class="post-metadata">

**Author:** ![steve.dower](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steve.dower/32/56_2.png) [@steve.dower](https://discuss.python.org/u/steve.dower)\
**Post date:** [July 9, 2019, 6:48am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/13 "2019-07-09T06:48:17Z")

</div>

> [@vstinner](#):
>
> Now the question is if someone here wants to go further is deprecate all distutils commands except sdist and bdist\_wheel? Steve Dower wants to deprecate bdist\_msi as well: I’m not sure who use bdist\_msi. It’s another form of GUI installer, so it’s similar to bdist\_wininst. I would also strongly encourage to use bdist\_wheel rather than bdist\_msi.

I think the others are fine to leave (though if people who work more closely with those tools want to say drop them then I’m fine with that too).

`bdist_msi` and `bdist_exe` don’t integrate with any other package managers, can’t be integrated with any other installer besides our own Python installer, and in any case are worse than simply copying the files. (If we had a `bdist_msm` I’d be slightly more sympathetic, but we don’t and probably should not 🙂 )

I also don’t necessarily think that wheels are always the alternative, particularly for embedded scenarios, but I do think that the fewer options we provide by default will help people find the option they actually need, rather than assuming that because it’s “blessed” it must see correct.

---

<div class="post-metadata">

**Author:** ![sumanah](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sumanah/32/1722_2.png) [@sumanah](https://discuss.python.org/u/sumanah)\
**Post date:** [October 7, 2019, 5:40pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/14 "2019-10-07T17:40:17Z")

</div>

> [@vstinner](#):
>
> Would it be possible to create a grant to pay someone to update the distutils doc? With having in mind that distutils code will be moved into setuptools in the long term. So maybe copy distutils doc into setuptools doc, and then rewrite it to replace distutils with setuptools? Or even pay someone to move distutils into setuptools?

> [@pradyunsg](#):
>
> /cc @sumanah, who is maintaining [https://wiki.python.org/psf/Fundable%20Packaging%20Improvements](https://wiki.python.org/psf/Fundable%20Packaging%20Improvements). The distutils-to-setuptools API moving work is already listed there.

I am the person who’s done the most work on [the Fundable Packaging Improvements page](https://wiki.python.org/psf/Fundable%20Packaging%20Improvements) but anyone within the [Packaging WG](https://wiki.python.org/psf/PackagingWG) should be able to edit it, such as @EWDurbin or @ncoghlan or @ewa.jodlowska. Please feel free to talk with one of them about adding a section about this documentation work! (I’m very busy this month, and sorry for the delay in replying.)

---

<div class="post-metadata">

**Author:** ![hugovk](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hugovk/32/14505_2.png) [@hugovk](https://discuss.python.org/u/hugovk)\
**Post date:** [October 8, 2019, 8:45am UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/15 "2019-10-08T08:45:26Z")

</div>

> [@cgohlke](#):
>
> > PyPI doesn’t even allow you to upload bdist\_wininst (See [PEP 527](https://www.python.org/dev/peps/pep-0527/)) anymore
> 
> Maybe a bug: [Pillow](https://pypi.org/project/Pillow/#files) still uploads `bdist_wininst` installers for Windows.

Since the [newest release (6.2.0)](https://pypi.org/project/Pillow/6.2.0/#files), Pillow [no longer uploads](https://github.com/python-pillow/Pillow/pull/4029) `bdist_wininst` installers. There could still be a bug in PyPI that allows uploading them, because we uploaded them for the previous 6.1.0 release in July, and earlier quarterly releases.

---

<div class="post-metadata">

**Author:** ![dustin](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dustin/32/149_2.png) [@dustin](https://discuss.python.org/u/dustin)\
**Post date:** [October 8, 2019, 4:04pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/16 "2019-10-08T16:04:23Z")

</div>

> [@cgohlke](#):
>
> Maybe a bug: [Pillow](https://pypi.org/project/Pillow/#files) still uploads `bdist_wininst` installers for Windows.

PEP 527 is not “fully” implemented, some projects were grandfathered in and allowed to continue publishing the deprecated filetypes. I created [Fully implement PEP 527 · Issue #6792 · pypi/warehouse · GitHub](https://github.com/pypa/warehouse/issues/6792) to determine if this is still necessary.

---

<div class="post-metadata">

**Author:** ![sumanah](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sumanah/32/1722_2.png) [@sumanah](https://discuss.python.org/u/sumanah)\
**Post date:** [June 16, 2020, 7:30pm UTC](https://discuss.python.org/t/deprecate-bdist-wininst/1929/17 "2020-06-16T19:30:05Z")

</div>

> [@pradyunsg](#):
>
> /cc @sumanah, who is maintaining [https://wiki.python.org/psf/Fundable%20Packaging%20Improvements](https://wiki.python.org/psf/Fundable%20Packaging%20Improvements). The distutils-to-setuptools API moving work is already listed there.

This list of packaging improvement ideas awaiting funding has now moved to [GitHub - psf/fundable-packaging-improvements: Packaging improvements that could be funded](https://github.com/psf/fundable-packaging-improvements) and people can submit pull requests to suggest additions.
