Solved: Python Setup.py Bdist_Wheel Did Not Run Successfully

The reason could be missing dependencies

Reading time icon 4 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • To fix the python setup.py bdist_wheel did not run successfully error, try installing the wheel, or use the pip install cmake command.
  • Continue reading to learn about other solutions.
Python Setup.py Bdist_Wheel Did Not Run Successfully

If you have encountered a python setup.py bdist_wheel did not run successfully error during the wheel generation process, then this guide can help.

We will explore the common causes behind its unsuccessful execution and explore effective solutions to overcome the issue.

What causes this build failure?

  • Missing dependencies or virtual environment issues.
  • Lack of permissions or Python version incompatibilities between interpreter and project.
  • Network issues or errors in setup.py script.

How can I fix the python setup.py bdist_wheel did not run successfully error?

Before performing any troubleshooting steps, ensure you have checked these things:

  • Ensure the Python version you are building matches with what the project supports.
  • Check for the syntax errors in the script.

1. Install the cmake module

  1. Press the Windows key, type vs code, cmd, or any other console compatible with Python, and click Open.
  2. Type the following commands depending upon the conditions explained and hit Enter:
Python Setup.py Bdist_Wheel Did Not Run Successfully
pip install cmake
pip3 install cmake

If you don't have pip in your PATH environment variable
python -m pip install cmake
python3 -m pip install cmake

2. Check if you have wheel installed

  1. Open Python or any compatible console, then type the following commands one by one and hit Enter:
    • pip install wheel setuptools --upgrade
      pip3 install wheel setuptools --upgrade
      python -m pip install wheel setuptools --upgrade
      python3 -m pip install wheel setuptools --upgrade
  2. If you are using Ubuntu, type the following commands one by one to install these prerequisites first and press Enter:
    • sudo apt-get install gcc libpq-dev -y
      sudo apt-get install python-dev python-pip -y
      sudo apt-get install python3-dev python3-pip python3-venv python3-wheel -y

3. Upgrade the version of PIP

Open Python or any compatible console, type the following command according to your conditions, and hit Enter:

# if you have pip already installed
pip install --upgrade pip

# if your pip is aliased as pip3 (Python 3)
pip3 install --upgrade pip

# if you don't have pip in your PATH environment variable
python -m pip install --upgrade pip

# if you don't have pip in your PATH environment variable
python3 -m pip install --upgrade pip

# if you get a permissions error when upgrading pip
pip install --upgrade pip --user

# upgrade pip scoped to the current user (if you get permissions error)
python -m pip install --user --upgrade pip
python3 -m pip install --user --upgrade pip

Keeping the latest versions of PIP and Python installed can help you avoid a lot of issues such as Permission denied; read this guide to learn more.

4. Reinstall the packages

Open a terminal of your choice, then copy & paste the following commands one by one, and hit Enter after every command:

pip uninstall -r requirements.txt
pip install -r requirements.txt

# or with pip3
pip3 uninstall -r requirements.txt
pip3 install -r requirements.txt

5. Skip the wheel-building process

  1. Visit the pypi page of wheel, and download the file under Built Distribution.
  2. Next, open the terminal in a folder where .whl is located, copy & paste the following this command one by one and hit Enter after every command:
    • pip install wheel-0.37.1-py2.py3-none-any.whl
      pip3 install wheel-0.37.1-py2.py3-none-any.whl
      python -m pip install wheel-0.37.1-py2.py3-none-any.whl
      python3 -m pip install wheel-0.37.1-py2.py3-none-any.whl
  3. If the error persists, type the following command to upgrade the version of CMake and hit Enter:
pip install cmake --upgrade
pip3 install cmake --upgrade

# If you don't have pip in your PATH environment variable
python -m pip install cmake --upgrade
python3 -m pip install cmake --upgrade

6. Add setup_requires condition to your file

  1. Locate your setup.py file and right-click it to open in VS Code or any compatible console.
  2. Add this line to your script:
setup(
    # rest,
    setup_requires=['wheel']
)

If this doesn’t help, you need to add these lines to your setup.py file:

import setuptools
from setuptools import setup

To conclude, the Python setup.py bdist_wheel did not run successfully issue occurs mainly due to missing dependencies and compliers or syntax errors in your script.

To fix the error, you need to ensure the Python version you are using is compatible with the package, check the script for errors, upgrade PIP, or install the CMake module.

If you are facing another error with Python, you can use the Try-except-print method; we have a separate guide on how to use it.

Speaking of errors, if you ever get stuck with Python runtime errors, then check the variables for issues and mathematical errors; read this guide to learn more.

Did we miss a step that helped you to fix this build error? Don’t hesitate to mention it in the comments section below. We will happily add it to the list.