khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
14.25k stars 705 forks source link

Incompatible with Python 3.12 #522

Closed lrq3000 closed 7 months ago

lrq3000 commented 1 year ago

Just to let you guys know that the pre-release/github version of khoj-assistant (hash https://github.com/khoj-ai/khoj/commit/9677eae79192aed2171a433f4ae4d9adff7afba1) is currently incompatible with Python 3.12 because of two issues:

  1. pyproject.toml requires pyyaml==6.0, which causes an AttributeError: cython_sources as described here. Updating the requirement to pyyaml>=6.0 or using Python 3.11 without changing this requirement fixes this issue.
  2. torch requirement does not yet offer builds for Python 3.12, the latest supported version is Python 3.11. This issue cannot be fixed currently (as of October 2023).

So there is nothing to do but wait, I am just reporting this issue in case others get the same error.

sabaimran commented 1 year ago

Thank you for reporting, @lrq3000 ! Updating pyyaml should be trivial, but torch might be trickier. We'll watch out for this.

ststudio907 commented 12 months ago

I'm very new to python. Literally just got it to use khoj with obsidian. How do I update requirements, or downgrade to python 3.11?

lrq3000 commented 11 months ago

@ststudio907 As long as you can't see a "cp312" package here, pytorch is not available for py3.12 and hence py<=3.11 is required.

An easy way to get py3.11 or any othes version is to install a miniconda distribution with python 3.11, or if you already have it, create an environment under python 3.11.

debanjum commented 7 months ago

Thanks for the initial investigation @lrq3000. Khoj should support python 3.12 once PR #690 is merged. This got unblocked since Pytorch added support for python 3.12 in mainline version 2.2.2.

lrq3000 commented 7 months ago

That's great to hear, thank you for the heads up!