You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行python setup.py bdist_wheel时'universal'选项报错如何修复?

Fixing "error: error in setup.cfg: command 'bdist_wheel' has no such option 'universal'"

Hey there, I’ve run into this exact issue before when updating my build tools—let’s get this sorted out quickly.

What’s causing this?

The universal option under the [bdist_wheel] section in your setup.cfg is deprecated in newer versions of setuptools and wheel. The maintainers moved this setting to a dedicated [wheel] section instead, so the old configuration is no longer recognized.

Step-by-step fixes:

  1. Update your build tools first
    Outdated versions might have conflicting behaviors, so let’s make sure we’re working with the latest releases:

    pip install --upgrade setuptools wheel
    
  2. Fix your setup.cfg file
    Open your setup.cfg and look for a section that looks like this:

    [bdist_wheel]
    universal = 1
    

    Replace it with this (if you still want to generate a universal wheel compatible with both Python 2 and 3):

    [wheel]
    universal = 1
    

    If you don’t need a universal wheel, you can just delete that entire [bdist_wheel] section entirely.

  3. Re-run your build command
    Now try executing the command again:

    python setup.py bdist_wheel
    

    This should work without throwing the error now.

Extra note:

If you’re using setup.py directly instead of setup.cfg, you can achieve the same universal wheel effect by adding the universal=True parameter to your setup() call:

setup(
    # ... other parameters ...
    universal=True
)

内容的提问来源于stack exchange,提问作者pjz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:54:47