Building Wheel for a Python Package Failed

Today I was trying to install frappe-bench package within a newly created python 3 virtual environment in my Ubuntu 20.04. It gave this error in terminal.

ERROR: Command errored out with exit status 1:
command: /home/junaid/python-env/erpnext/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g6347jx5/python-crontab/'"'"'; __file__='"'"'/tmp/pip-install-g6347jx5/python-crontab/'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);'"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-kw47_972
    cwd: /tmp/pip-install-g6347jx5/python-crontab/
Complete output (8 lines):
/usr/lib/python3.8/distutils/ UserWarning: Unknown distribution option: 'release'
usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
    or: --help [cmd1 cmd2 ...]
    or: --help-commands
    or: cmd --help

error: invalid command 'bdist_wheel'
ERROR: Failed building wheel for python-crontab

However, the package appeared to be installed even with above error. Then I got this SO thread in my search It has this answer from a pip maintainer briefing about the behavior of pip, so pip was trying to build the wheel before attempting by install.

Same thread has another answer suggesting to install the wheel package.

pip3 install wheel

I tried it. Then installing python-crontab worked without any errors!


Leave a Reply

Your email address will not be published. Required fields are marked *