Getting errors when trying to install flask-mongoengine
on Win10 computer with WSL2/Debian. Am able to install other project dependencies without issue.
Command entered was: python3 -m pip install flask-mongoengine
, error output follows)
Have tried doing similar using sudo
, with no improvement.
Collecting flask-mongoengine
Using cached flask-mongoengine-0.9.5.tar.gz (111 kB)
ERROR: Command errored out with exit status 1:
command: /mnt/d/dev/opalapi/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wl69gb5c/flask-mongoengine/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wl69gb5c/flask-mongoengine/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ldtngp0q
cwd: /tmp/pip-install-wl69gb5c/flask-mongoengine/
Complete output (44 lines):
WARNING: The wheel package is not available.
ERROR: Command errored out with exit status 1:
command: /mnt/d/dev/opalapi/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-l5ep1tsz/rednose/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-l5ep1tsz/rednose/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-w93yg6mf
cwd: /tmp/pip-wheel-l5ep1tsz/rednose/
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 rednose
ERROR: Failed to build one or more wheels
Traceback (most recent call last):
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
subprocess.check_call(cmd)
File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/mnt/d/dev/opalapi/venv/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpleem7stb', '--quiet', 'rednose']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-wl69gb5c/flask-mongoengine/setup.py", line 36, in <module>
setup(
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 143, in setup
_install_setup_requires(attrs)
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/setuptools/__init__.py", line 138, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/setuptools/dist.py", line 695, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 781, in resolve
dist = best[req.key] = env.best_match(
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1066, in best_match
return self.obtain(req, installer)
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1078, in obtain
return installer(requirement)
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/setuptools/dist.py", line 754, in fetch_build_egg
return fetch_build_egg(self, req)
File "/mnt/d/dev/opalapi/venv/lib/python3.8/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
raise DistutilsError(str(e))
distutils.errors.DistutilsError: Command '['/mnt/d/dev/opalapi/venv/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpleem7stb', '--quiet', 'rednose']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
2
Answers
The error message
error: invalid command 'bdist_wheel'
means, Python can’t find the wheel module. Install thewheel
module first bypip install wheel
and thenpip install flask-mongoengine
.It’s clearly the wheel issue, as wheel is not installed in your system.
Wheel was developed as a quicker and more reliable method of installing Python software than re-building from source code every time.
Use this command
If you are using python3 and not having it as your default python then use