Open liffiton opened 6 years ago
Interesting. Thanks for filing the issue. Could this be a permissions issue? If not, create_config_directory
looks like it's broken.
As a work around could you create the ~/.config/ok/
folder and then see if it works?
The directory is created correctly. The code is trying to read the auth_refresh
file, though, and that doesn't exist. I can create it, but then the next line fails on trying to load from an empty file. The code seems to be assuming that the auth_refresh
file was created and written already, but it never was.
Odd. We'll take a look
This probably won't work but worth a shot: _ = ok.auth(inline=True, force=True)
It works fine with force=True
. I got the prompt to get a code from okpy.org, I entered the code, and it says I've successfully logged in.
Is there some part of the logic that assumes you've authenticated previously or something?
If anyone runs into the same issue, I've included the following in my students' notebooks as a workaround:
import os
if not os.path.exists(os.path.join(os.environ.get("HOME"), ".config/ok/auth_refresh")):
ok.auth(force=True)
else:
ok.auth(inline=True)
I'm trying out okpy in a Jupyter notebook using the example data science project linked from the "Welcome to OK!" block in the front page of my course on okpy.org.
I've edited
hw04.ok
to point to my course's endpoint.When I execute the first block in the notebook, I get a FileNotFoundError.
Sure enough, that file does not exist.