question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError in writer.generate_repr()

See original GitHub issue

Hi, I am trying to parse an Orca output file and get the optimized coordinates in the form of an xyz file (or even better, the SMILES). I have the following code:

data = cclib.io.ccread(file_path)
writer = cclib.io.xyzwriter.XYZ(data)
new_repr = writer.generate_repr()

The line for writer.generate_repr() throws the following error: KeyError: 'comments'

Any help would be appreciated

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brigreenscommented, Sep 28, 2022

Hi thank you so much for your help. You were correct, for some reason in the command line it was saying version 1.7.2 but in my jupyter notebook it was 1.6.1. I fixed the path issue and with version 1.7.2 I no longer have the error.

0reactions
shivupacommented, Sep 28, 2022

yay! ok thanks for reporting back. Going to close this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python KeyError Exceptions and How to Handle Them
In this tutorial, you'll learn how to handle Python KeyError exceptions. They are often caused by a bad key lookup in a dictionary,...
Read more >
How to Fix KeyError Exceptions in Python - Rollbar
The Python KeyError is an exception that occurs when an attempt is made to access an item in a dictionary that does not...
Read more >
What is KeyError in Python? Dictionary and Handling Them
KeyError in Python is raised when you attempt to access a key that is not in a dictionary.
Read more >
How to fix Python KeyError Exceptions in simple steps?
Know about Python KeyError Exception. ... The get()is useful in cases where the exception is raised due to a failed dictionary LookupError.
Read more >
I'm getting Key error in python - Stack Overflow
A KeyError generally means the key doesn't exist. So, are you sure the path key exists? From the official python docs: exception KeyError....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found