Mycroft Community Forum

[SOLVED] Duckduckgo Error Traceback

Afternoon,

I’m having an issue getting the Duckduckgo skill to function properly. I keep getting the same error as can be seen below in the output of my /var/log/mycroft/skills.log:

2021-02-28 11:18:59.448 | INFO | 72507 | QuestionsAnswersSkill | Searching for who is george washington
2021-02-28 11:18:59.452 | INFO | 72507 | requests.packages.urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai
2021-02-28 11:18:59.453 | INFO | 72507 | requests.packages.urllib3.connectionpool | Starting new HTTP connection (1): duckduckgo.com
Removing event fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
2021-02-28 11:18:59.601 | ERROR | 72507 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:835 | An error occurred while processing a request in Duckduckgo Skill
Traceback (most recent call last):
File “/home/costa/mycroft-core/mycroft/skills/mycroft_skill/event_container.py”, line 66, in wrapper
handler(message)
File “/home/costa/mycroft-core/mycroft/skills/common_query_skill.py”, line 76, in __handle_question_query
result = self.CQS_match_query_phrase(search_phrase)
File “/opt/mycroft/skills/mycroft-fallback-duck-duck-go.mycroftai/init.py”, line 133, in CQS_match_query_phrase
answer = self.respond(query[len(test):])
File “/opt/mycroft/skills/mycroft-fallback-duck-duck-go.mycroftai/init.py”, line 109, in respond
r = ddg.query(query)
File “/home/costa/mycroft-core/.venv/lib/python3.9/site-packages/ddg3.py”, line 30, in query
return Results(xml)
File “/home/costa/mycroft-core/.venv/lib/python3.9/site-packages/ddg3.py”, line 49, in init
self.results = [Result(elem) for elem in xml.getiterator(‘Result’)]
AttributeError: ‘xml.etree.ElementTree.Element’ object has no attribute ‘getiterator’
George Washington (February 22, 1732 – December 14, 1799) was an American political leader, military general, statesman, and founding father who served as the first president of the United States from 1789 to 1797.
2021-02-28 11:19:00.549 | INFO | 72507 | QuestionsAnswersSkill | Answer from fallback-wolfram-alpha.mycroftai

  • Arch Linux
  • Latest version of mycroft
  • Python 3.9.2-1

I’d appreciate some help figuring this one out. Thanks so much!

Hi @Bluedasher & welcome!!

The DuckDuckGo module is based on the ddg3 Python library which seems not maintained anymore.

There is a known issue with Python 3.9 and this module, I would recommend to use the module developed by @JarbasAl which use the requests Python library instead of the ddg3 .

2 Likes

Thank you for the quick response!

I removed the built in mycroft duckduckgo skill, used ‘pip uninstall’ to remove ddg3, and installed the skill you linked using:

source venv-activate.sh
msm install GitHub - JarbasSkills/skill-ddg: duck duck go skill

It works flawlessly. Thank you!

2 Likes

You don’t even need to uninstall the skill, the new skill installation will automatically blacklist the current module. :slight_smile:

Glad to see everything working!