What can I do if I am getting this error, "error: invalid command 'bdist_wheel'" when using pip install?

Posted 1 month, 2 weeks ago

Problem:

"error: invalid command 'bdist_wheel'" when using pip install?

For example you are installing django-watson with pip installer 
pip install django-watson
You might be getting this type of output on terminal, (highlighted in red color or something):

Building wheel for django-watson (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/vish/dev/prod/factober/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-645pn7hz/django-watson/setup.py'"'"'; __file__='"'"'/tmp/pip-install-645pn7hz/django-watson/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-5tcpjukv
       cwd: /tmp/pip-install-645pn7hz/django-watson/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
  
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for django-watson
  Running setup.py clean for django-watson

Solution:

Try to install or upgrade these packages

pip install wheel

Trying running pip command, even if you get the same error continue with following upgrades.

pip install setuptools --upgrade

or (if previous command fails)

pip install setuptools --upgrade --force

Where can I find more information about this issue?

You can find it here on stackoverflow.