Molecule installation method (one of):
Ansible installation method (one of):
When docker python dependency is not installed an error message is shown not a stack trace.
--> Sanity checks: 'docker'
Traceback (most recent call last):
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/driver/docker.py", line 223, in sanity_checks
import docker
ModuleNotFoundError: No module named 'docker'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/foobar/work/barfoo/infrastructure/.venv/bin/molecule", line 8, in <module>
sys.exit(main())
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/command/test.py", line 147, in test
base.execute_cmdline_scenarios(scenario_name, args, command_args)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/command/base.py", line 107, in execute_cmdline_scenarios
execute_scenario(scenario)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/command/base.py", line 149, in execute_scenario
execute_subcommand(scenario.config, action)
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/command/base.py", line 138, in execute_subcommand
return command(config).execute()
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/command/destroy.py", line 107, in execute
self._config.provisioner.destroy()
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/provisioner/ansible.py", line 700, in destroy
pb.execute()
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/provisioner/ansible_playbook.py", line 105, in execute
self._config.driver.sanity_checks()
File "/home/foobar/work/barfoo/infrastructure/.venv/lib/python3.8/site-packages/molecule/driver/docker.py", line 228, in sanity_checks
except requests.exceptions.ConnectionError:
UnboundLocalError: local variable 'requests' referenced before assignment
Resolved by pip install docker==4.2.0 btw.
Most helpful comment
Resolved by
pip install docker==4.2.0btw.