I'm using a jupyter notebook, and I'm trying to query AWS athena using PyAthena module, via the notebook.
My first line in the project is:
athena = pyathena.connect(profile_name="NAME")
which works in any other platform on my computer (iPython, Pycharm..) but doesn't work on the Jupyter Notebook, and returns:
ProfileNotFound: The config profile (core) could not be found
I tried changing the env variable like so: !set AWS_CONFIG_FILE="~/.aws/config"
but it didn't work.
Any ideas?
Most likely you are confusing the role of an AWS config and credential file (see the docs here: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
Assuming that returns a successful response, you should be able to use PyAthena like the following:
If that still fails, it's likely because you did not setup your named profile correctly in
~/.aws/credentials