-1

I've been faced SupabaseException: supabase_url is required. Here are codes

import os
from supabase import create_client, Client

url: str = os.environ.get('https://mine.supabase.co')
key: str = os.environ.get("xxxxminexxx")
supabase: Client = create_client(url, key)

SupabaseException: supabase_url is required.

supabase version : 1.0.4 python : 3.10.9

i don't know how to deal with this problem. Plz help.

  1. make account supabase https://supabase.com/
  2. pip install supabase
  3. Run code
  4. Error
1
  • 2
    Welcome to Stack Overflow. That isn't how os.environ works. It expects a key: value pair, so whatever your variable your URL is defined as, you get that and not the actual value itself. i.e. if os.environ has URL=http://....", you do a os.environ.get("URL") Commented Sep 11, 2023 at 7:59

1 Answer 1

1

If you are getting the environment variables from the operating system you should be checking for the variable name which you can setup with dotenv python package or a normal export SUPABASE_URL="my-url-to-my-awesome-supabase-instance" and not a url or anon_key as you have in your example. Take a look at the example below which is also outlined in the Supabase Python docs

import os
from supabase import create_client

url = os.environ.get("SUPABASE_URL")
key = os.environ.get("SUPABASE_KEY")
supabase = create_client(url, key)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.