Python pip – error: invalid command ‘bdist_wheel’

时间:2023-03-08 17:22:11
Python pip – error: invalid command ‘bdist_wheel’
原文@http://software-engineer.gatsbylee.com/python-pip-error-invalid-command-bdist_wheel/

Python pip – error: invalid command ‘bdist_wheel’

环境

  • python-setuptools 0.6.10 from CentOS 6 Base
  • pip 7.1.0 from https://bootstrap.pypa.io/get-pip.py
  • python 2.6

问题?

When I install python modules, such ans Flask, SQLAlchemy, etc., I got this error “error: invalid command ‘bdist_wheel'”.

原因?

This is compatibility issue between pip and setuptools.

The python-setuptool 0.6.10 from CentOS 6 uses python module, setuptools.

from setuptools import setup

However, the pip 7.1.0 expects that the installed python setuptool module use distutils.core.

from distutils.core import setup

解决方案?

There could be two approaches.

1. using the pip packages from CentOS 6 which is 1.3.1.

$ python -m pip uninstall pip setuptools
$ yum install python-pip python-setuptools

2. upgrading python setuptool module

$pip install setuptools --upgrade