KeyError in writer.generate_repr()
See original GitHub issueHi, 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:
- Created a year ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
yay! ok thanks for reporting back. Going to close this