0ssamaak0 / CLIPPyX

AI Powered Image search tool offers content-based, text, and visual similarity system-wide search.
MIT License
196 stars 17 forks source link

Which python version to use? #17

Closed sag3002 closed 1 week ago

sag3002 commented 3 weeks ago

I tried using Python 3.12 and 3.10 using virtual environment but was unable to run the app. It says unable to import Flask even though all dependencies are installed.

0ssamaak0 commented 3 weeks ago

Can you share the error? Note that the current installation steps are kinda outdated. I will update it soon with the next release

sag3002 commented 3 weeks ago

(venv) PS E:\CLIPPyX> CLIPPyX Traceback (most recent call last): File "E:\CLIPPyX\create_index.py", line 1, in from Index.create_db import * File "E:\CLIPPyX\Index\create_db.py", line 1, in import chromadb ModuleNotFoundError: No module named 'chromadb' Traceback (most recent call last): File "E:\CLIPPyX\server.py", line 1, in from flask import Flask, abort, request, jsonify, send_from_directory ModuleNotFoundError: No module named 'flask' Traceback (most recent call last): File "\?\E:\CLIPPyX\venv\Scripts\CLIPPyX-script.py", line 33, in sys.exit(load_entry_point('CLIPPyX', 'console_scripts', 'CLIPPyX')()) TypeError: 'module' object is not callable

sag3002 commented 3 weeks ago

Complete PowerShell input and output here: https://[pastebin.com/raw/rmkninfL](https://pastebin.com/raw/rmkninfL)

0ssamaak0 commented 3 weeks ago

There's a problem with your python environment. Can you show me the output of pip list? Or try to create a clean installation in clean env (preferably conda)

sag3002 commented 3 weeks ago

There's a problem with your python environment. Can you show me the output of pip list? Or try to create a clean installation in clean env (preferably conda)

https://pastebin.com/CSmFmJFf

0ssamaak0 commented 3 weeks ago

I think I got it. You have many Python versions installed. In main.py, it runs these commands:

subprocess.run(["python", "create_index.py"])
subprocess.run(["python", "server.py"])

which run in the default Python you have rather than this venv.

Please verify if this is the scenario so I can fix it.

sag3002 commented 3 weeks ago

I think I got it. You have many Python versions installed. In main.py, it runs these commands:

subprocess.run(["python", "create_index.py"])
subprocess.run(["python", "server.py"])

which run in the default Python you have rather than this venv.

Please verify if this is the scenario so I can fix it.

Yes! This was the issue it seems. I replace them with: subprocess.run([python_executable, "create_index.py"]) subprocess.run([python_executable, "server.py"])

and now it works

0ssamaak0 commented 3 weeks ago

Thanks for pointing to this issue, I will try to modify the main to avoid this problem! I will keep the issue open until I fix it

0ssamaak0 commented 1 week ago

Fixed in 2124eddc541dee15cb694a9afcd162a3eb62ab6f