unsupported operand type(s) for |: 'type' and 'type'
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
how did this error occur?
how did this error occur?
When I run Devika for the first time
@darrassi1 Doesnt help much, can you tell me the exact place?
python3 devika.py? or bun run dev? And line number. Can you send the full error.
@darrassi1 Doesnt help much, can you tell me the exact place?
python3 devika.py? or bun run dev? And line number. Can you send the full error.
python devika.py
It'd really help if you provide me with more context about the error. Send the full error
I had the same problem on the 6th step of the installation in (Windows 10):
Start the Devika server:
python devika.py
Check which python -V version you're using.
The TypeError: unsupported operand type(s) for |: 'type' and 'type' error is actually related to the syntax used in type hints.
This specific syntax, using the pipe (|) for union types, was introduced in Python 3.10 as a part of PEP 604.
The error suggests that our environment is using Python < 3.10, which does not support this syntax
I solved by upgrading python to the latest stable version 3.11.9
Then you will need to:
# Deactivate the current virtual environment
deactivate
# Remove the old virtual environment folder
Remove-Item venv -Recurse
# Create a new virtual environment with the updated Python version
python -m venv venv
# Activate the new virtual environment
.\venv\Scripts\Activate
# Reinstall the dependencies
pip install -r requirements.txt
hope it helps! Lets Keep Coding 😎💻