Forum Archive

Evernote module - not working in Python 3.5?

dsr20131017

I'm eagerly trying to move over to Pythonista 3 from the earlier version and have run into a problem:

I had some code working in Pythonista 2 just fine. In particular, this code accessed Evernote notes and notebooks.

When I did a copy/paste and try to run it in Pythonista 3, it didn't work at all. I fiddled around and didn't make much progress. My import statements were not even working.

My default Python version is 3.5. So I just tried running it in Python 2.7, and it works just fine.

Is there something I need to do to make Evernote code run in Python 3.5 in Pythonista?

Many thanks for any help.

ccc

If you put the following shebang line as the first line of your script then Pythonista will always run that script in Python 2:

#! python2

If you really want your code to run in Python 3 then you would need to post a snippet of that code here so that we can see the problem for ourselves. It is easier to debug Python code than English prose.

dsr20131017

@ccc - Many thanks. I will use the shebang line to use Python 2 until I get this figured out.

I do want the code to run in Python 3. Right now, I would be happy if I could just run the sample Evernote code from the Pythonista website.

I just did a cut-and-paste from the website into Pythonista 3, put in my auth_token, and fixed the print statements. When I run, I get the error:

No module named 'ttypes'

on this line:

import evernote.edam.userstore.constants as UserStoreConstants

Any idea where I might go from here?

Many thanks.