label-studio: Can't load sqlite.dll from current directory
I attempted to run label-studio from a windows computer with limited access. I installed the package via pip in a conda environment, all seems good so far. However when I try to run label-studio I get the following error:
(label-studio-3.7) Y:\>label-studio
Current platform is win32, apply sqlite fix
Can't load sqlite3.dll from current directory
The error seems to traceback to the following script: https://github.com/heartexlabs/label-studio/blob/ef93ceb9965c9bcd8b492e81bdef09d0bbd74c7e/label_studio/core/utils/windows_sqlite_fix/__init__.py
Perhaps I can attempt to manually copy the correct DLL to the “current directory”. However, In which folder should I copy this file to?
edit: I figured out the current working directory by printing out the current directories but I found that there were no .zip files in the directory. Still the issue remains when I downloaded the .zip files and placed them in the folder.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (5 by maintainers)
How did you resolve this issue exactly? I seem to be facing the same issue in my system
You can close this issue. Turns out my actual issue had to do with internal proxy settings that interfered with the html routing. I managed to solve it by changing some .env variables.
Hello, I tried to install label-studio today and I getting the same error related to sqlite. I tried to replace the dll (which was already there in the folder), but it didnt work. I will post more details of the startup logs later. is there any guidelines to solve this? Thanks.
edit: here is startup log:
Current platform is win32, apply sqlite fix Add current directory to PATH for DLL search: C:\Users\desuo => Database and media directory: C:\Users\desuo\AppData\Local\label-studio\label-studio => Static URL is set to: /static/ Traceback (most recent call last): File “C:\Users\desuo\anaconda3\envs\label\lib\runpy.py”, line 193, in _run_module_as_main “main”, mod_spec) File “C:\Users\desuo\anaconda3\envs\label\lib\runpy.py”, line 85, in run_code Starting new HTTPS connection (1): o227124.ingest.sentry.io:443 exec(code, run_globals) File "C:\Users\desuo\anaconda3\envs\label\Scripts\label-studio.exe_main.py", line 7, in <module> File “C:\Users\desuo\anaconda3\envs\label\lib\site-packages\label_studio\server.py”, line 282, in main setup_env() File “C:\Users\desuo\anaconda3\envs\label\lib\site-packages\label_studio\server.py”, line 40, in setup_env application = get_wsgi_application() File “C:\Users\desuo\anaconda3\envs\label\lib\site-packages\django\core\wsgi.py”, line 12, in get_wsgi_application django.setup(set_prefix=False) File "C:\Users\desuo\anaconda3\envs\label\lib\site-packages\django_init.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "C:\Users\desuo\anaconda3\envs\label\lib\site-packages\django\conf_init.py", line 82, in getattr self.setup(name) File "C:\Users\desuo\anaconda3\envs\label\lib\site-packages\django\conf_init.py", line 69, in setup self.wrapped = Settings(settings_module) File "C:\Users\desuo\anaconda3\envs\label\lib\site-packages\django\conf_init.py", line 170, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "C:\Users\desuo\anaconda3\envs\label\lib\importlib_init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 967, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 677, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 728, in exec_module File “<frozen importlib._bootstrap>”, line 219, in call_with_frames_removed File “C:\Users\desuo\anaconda3\envs\label\lib\site-packages\label_studio\core\settings\label_studio.py”, line 46, in <module> from label_studio.core.utils.common import collect_versions File “C:\Users\desuo\anaconda3\envs\label\lib\site-packages\label_studio\core\utils\common.py”, line 36, in <module> from drf_yasg.inspectors import CoreAPICompatInspector, NotHandled File "C:\Users\desuo\anaconda3\envs\label\lib\site-packages\drf_yasg\inspectors_init.py", line 5, in <module> from .field import ( File “C:\Users\desuo\anaconda3\envs\label\lib\site-packages\drf_yasg\inspectors\field.py”, line 406, in <module> (serializers.NullBooleanField, (openapi.TYPE_BOOLEAN, None)), AttributeError: module ‘rest_framework.serializers’ has no attribute ‘NullBooleanField’ Sentry is attempting to send 2 pending error messages Waiting up to 2 seconds Press Ctrl-Break to quit https://o227124.ingest.sentry.io:443 “POST /api/5820521/store/ HTTP/1.1” 200 41
EDIT 2: solved following this thread
https://github.com/heartexlabs/label-studio/issues/2979#issuecomment-1255252899
I guess, the possible workaround is to change the path variable in “label_studio/core/utils/windows_sqlite_fix/init.py” file. In my case, the default directory of conda Powershell was set as “C:\Users\This_user”, so that label-studio was looking for sqlite3.dll inside it. Changing variable “path_to_dll” from os.path.abspath(‘.’) to os.path.abspath(r’anaconda3\envs\label-studio\Library\bin’) inside init.py fixed it.
My problem was that there were multiple versions of sqlite3.dll on my computer and Python was using a version that was not compatible with Label Studio. I found this out by running the following Python code: import sqlite3 sqlite3.sqlite_version Then I searched my computer for sqlite3.dll and deleted all of the files with that name. The wrong version came with AWS CLI. Then I downloaded the latest version and copied to C:\Users<USER>\Anaconda3\Library\bin. Make sure this path is added to your PATH variable.
@halilergul1 try to use anaconda python and its environment, it already has the proper sqlite library. Or try to download sqlite dll and place it in the same folder where you run LS. LS should download it automatically, but looks like something is broken, could you show your startup logs?