Cannot resolve "missing" python package (it isn't missing!) when trying to run open source AI program
I'm rather new to python and AI. I want to use the popular package label-studio to build training data using images that I'll apply the AI labelling steps on.
The problem is that after cloning the repo from github and following all the instructions, I'm getting the following error:
Traceback (most recent call last): File "/Users/markalsip/label-studio/label_studio/manage.py", line 11, in from django.conf import settings ModuleNotFoundError: No module named 'django' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/markalsip/label-studio/label_studio/manage.py", line 18, in raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
The first problem is that django IS installed and my PYTHONPATH environment variable, by all means at my disposal, is correct:
django-admin --version
returns: 3.2.25
echo $PYTHONPATH
returns: /Users/markalsip/label-studio/env/lib/python3.12/site-packages:
I should point out the instructions for this program indicate I should run it in what I believe to be a virtual environment. I have done this (my current root folder is Marks-MBP:label-studio, thus the text shown in the prompt):
Marks-MBP:label-studio markalsip$ source /Users/markalsip/label-studio/env/bin/activate (env) Marks-MBP:label-studio markalsip$ python --version
returns: Python 3.12.0
To run the python program, I am told to: python label_studio/manage.py runserver
I should back up and say that ALL of the things I'm doing here, such as checking paths, environment variables, etc., is done while I'm in this environment. I got there by the command:
source /Users/markalsip/label-studio/env/bin/activate
What I've tried: Uninstalling and reinstalling django Uninstalling and reinstalling the label_studio Listed installed packages from both the command line, as well as directly accessing them (e.g. the django django-admin --version, wbich returns 3.2.25)
Verifying my environment variable don't look wonky. My entire .bash_profile is pretty simplistic:
# Setting PATH for Python 3.12
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:${PATH}"
PYTHONPATH="/Users/markalsip/label-studio/env/lib/python3.12/site-packages:$PYTHONPATH"
export PATH
export PYTHONPATH
I also found a recommendation to ensure there are no .txt files in the label program source folder that list additional dependencies. I find no such file.
I saw a note during the install process that django itself had two dependencies. I checked and both of those are installed.
I am at loss, and a bit disappointed. I was able to cobble together a nice python program that uses various python packages and make a program that can recognize features in images I have randomly downloaded from the internet. Very encouraging! My next step would be to use this labelling program to start defining features in images on my own, and use that to train a model. (BTW, this label package I am using is said to be a replacement for the popular 'labellmg', so I went with that.)
Sorry so verbose. If I'm asking for help on something I think I owe it to the reader to give them everything I've tried. TIA for any and all help.