wxPython error: legacy-install-failure [Fixed]

Are you getting the error “wxPython error: legacy-install-failure” when installing the package using PIP? Yes, you have come to the right place. Today, I will show you how to solve this error.

This error can occur for various reasons. You will see all solutions today, and you can apply these solutions to solve this error, “wxPython legacy-install-failure.

[Fixed]: wxPython error: legacy-install-failure

  • Before running the ‘pip install‘ command. Upgrade “pip, setuptools, and wheel” to get rid of this error.
  • You should check the compatibility of the wxPython with the Python version.
  • If you are a windows user you can install the wxPython from unofficial binaries.
  • You can use ‘–pre‘ with the pip install command to get rid of this error.
Failed to build wxPython
Installing collected packages: wxPython
  × Running setup.py install for wxPython did not run successfully.
  │ exit code: 1

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

wxPython Encountered error while trying to install package.
╰─> wxPython

The first and easiest solution is to upgrade your pip version. Here are the commands to upgrade your pip version.

Commands to –Upgrade PIP

# If pip is already installed in your system
pip install --upgrade pip

# If your pip is aliased as pip3
pip3 install --upgrade pip

# If you don't have pip in your PATH environment variable you can use Python before command.

python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
py -m pip install --upgrade pip

# If you have easy_install you can install packages using easy_install
easy_install --upgrade pip

# If you get a permissions error yo can run command as admin
sudo easy_install --upgrade pip

# If you get a permissions error when upgrading pip you can upgrde for a specific user

pip install --upgrade pip --user

# Installing directly from get-pip.py (for Linux and Mac users)
curl https://bootstrap.pypa.io/get-pip.py | python

# If you get permissions issues you can run this command
curl https://bootstrap.pypa.io/get-pip.py | sudo python

# Alternative for Red Hat / CentOS / Fedora
sudo yum install epel-release
sudo yum install python-pip
sudo yum update python-pip

Now try to install the package you are trying to install before upgrading the PIP. I hope your problem is solved now.

[Fixed]: How to Remove \xa0 from a string in Python?

# pip install wxPython

If you are still getting this error. Don’t worry, now upgrade your setuptools and wheel.

pip install --upgrade setuptools wheel
pip3 install --upgrade setuptools wheel

python -m pip install --upgrade setuptools wheel
python3 -m pip install --upgrade setuptools wheel
py -m pip install --upgrade setuptools wheel

You updated “setuptools and wheel“, still getting the error “Error: legacy-install-failure“? Well, now run your pip command with –no-cache-dir.

pip install wxPython --no-cache-dir
pip3 install wxPython --no-cache-dir

If you are still getting the error, you can download the wxPython package manually and then install it from your local machine.

Conclusion on wxPython error: legacy-install-failure

Programmers, We discussed how we can solve the error “wxPython error: legacy-install-failure“. If you are still getting the error, please let us know in the comments section. before running the ‘pip install wxPython‘ command. Upgrade “pip, setuptools, and wheel” to get rid of this error.

Leave a Reply