CSSE1001 / MyPyTutor

Interactive tutorial application for Python3.
Other
7 stars 12 forks source link

Mac Keychain Error #181

Open BraeWebb opened 7 years ago

BraeWebb commented 7 years ago

There is an error with MyPyTutor on Macs when the password is to be stored in the python keyring module.

The error the is show is

NameError: name 'api' is not defined

I believe the cause of this issue is that a requirement of the keyring module for mac is the six module. This module for some reason seems to have been installed with previous python versions but does not come with python 3.6.

In the file where the error occurs there is this code block which will cause api to be undefined if there is an error importing another file.

try:
    from . import _OS_X_API as api
except Exception:
    pass

Removing the try/except provides a more helpful error message

ModuleNotFoundError: No module named 'six'

The solution to this error is possibly to install the module six before installing the keyring module as the keyring module does not do this automatically and manually installing the six module does resolve the issue.

ironstrider commented 7 years ago

This should solve the issue: https://gist.github.com/haliaeetus/ae18083910b12d280e4a8e53db568a88

As with #182, issue should remain open until this solution is tested & working, & bundled with MPT.