-
|
Hey! 👋 This error is usually caused by your .env or config.yaml file not being encoded in UTF-8. The key issue is: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff
✅ How to fix it 1. Check your .env or config.yaml file
👉 In VS Code:
2. Remove invalid charactersSometimes the file contains hidden or corrupted characters.
3. Recreate the file (if unsure)If the problem persists:
4. Verify installationAlso make sure litellm is installed correctly: pip install litellm
💡 Why this happens Python expects UTF-8 encoding by default, but some files (especially on Windows) are saved as UTF-16 or ANSI, which causes this decoding error. 🚀 After fixing Run again: python -m litellm --proxy --config config.yaml
Hope this helps! Let me know if you still face issues 🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
-
Hello I have a question about some code. I can not get the code to work and pull litellm from python and get the server started.
Here is the code:
(venv) C:\Users\Desktop>python -m litellm --proxy --config config.yaml
Traceback (most recent call last):
File "", line 189, in _run_module_as_main
File "", line 148, in _get_module_details
File "", line 112, in get_module_details
File "C:\Users\Desktop\venv\Lib\site-packages\litellm_init.py", line 78, in
dotenv.load_dotenv()
~~~~~~~~~~~~~~~~~~^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\main.py", line 362, in load_dotenv
return dotenv.set_as_environment_variables()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\main.py", line 93, in set_as_environment_variables
if not self.dict():
~~~~~~~~~^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\main.py", line 76, in dict
resolve_variables(raw_values, override=self.override)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\main.py", line 239, in resolve_variables
for name, value in values:
^^^^^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\main.py", line 85, in parse
for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines
for mapping in mappings:
^^^^^^^^
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream
reader = Reader(stream)
File "C:\Users\Desktop\venv\Lib\site-packages\dotenv\parser.py", line 64, in init
self.string = stream.read()
~~~~~~~~~~~^^
File "", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Beta Was this translation helpful? Give feedback.