haaag / PyTwitch

A user-friendly tool for easily accessing and watching live streams, videos, and clips from Twitch.
MIT License
4 stars 0 forks source link

Traceback (most recent call last): error #1

Open ahmetkotanci opened 1 month ago

ahmetkotanci commented 1 month ago

I fallowed the installing instructions as described and getting error for some reason;

pytwitch
Traceback (most recent call last):
  File "/home/ahmet/packages/pytwitch/.venv/bin/pytwitch", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/twitch/__main__.py", line 25, in main
    twitch = setup.twitch(prompt, menu, args.player, args.no_markup)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/twitch/setup.py", line 165, in twitch
    api = TwitchApi()
          ^^^^^^^^^^^
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/twitch/api.py", line 261, in __init__
    super().__init__()
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/twitch/api.py", line 76, in __init__
    self.load_client()
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/twitch/api.py", line 89, in load_client
    self.client = httpx.Client(headers=self._get_request_headers())
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/httpx/_client.py", line 653, in __init__
    super().__init__(
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/httpx/_client.py", line 183, in __init__
    self.headers = Headers(headers)
                   ^^^^^^^^^^^^^^^^
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/httpx/_models.py", line 75, in __init__
    normalize_header_value(v, encoding),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ahmet/packages/pytwitch/.venv/lib/python3.12/site-packages/httpx/_utils.py", line 55, in normalize_header_value
    return value.encode(encoding or "ascii")
           ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
haaag commented 3 weeks ago

Hi ahmetkotanci,

Added credentials validation, can you try again?

ahmetkotanci commented 3 weeks ago

Hi. I cleanbuit above errors gone but now gives this error even though I properly entered my access token; [ ERROR ] twitch.api : Missing required environment variable: access_token (line:49)

haaag commented 3 weeks ago

Hey, can you describe where did you put the credentials?

You can use the -c, --config flag with the path to the .env file

ahmetkotanci commented 3 weeks ago

I put to env.template file.Also renamed file to .env

haaag commented 2 weeks ago

ahmetkotanci,

Using the flag -c, --config solved the problem??