question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError when trying to run label-studio after installing it via pip

See original GitHub issue

Describe the bug Installed Label Studio via pip, as described on main page. However, when I try to run it a Python exception is being thrown:

Traceback (most recent call last):
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,Starting new HTTPS connection (1): o227124.ingest.sentry.io:443

  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\some.user\Miniconda3\envs\label-studio\Scripts\label-studio.exe\__main__.py", line 7, in <module>
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\label_studio\server.py", line 282, in main
    _setup_env()
  File "C:\Users\some_user\Miniconda3\envs\label-studio\lib\site-packages\label_studio\server.py", line 40, in _setup_env
    application = get_wsgi_application()
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\django\core\wsgi.py", line 12, in get_wsgi_application
    django.setup(set_prefix=False)
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\django\__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\django\conf\__init__.py", line 82, in __getattr__
    self._setup(name)
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\django\conf\__init__.py", line 69, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\django\conf\__init__.py", line 170, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\some.user\Miniconda3\envs\label-studio\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\some.user\Miniconda3\envs\label-studio\lib\site-packages\label_studio\core\utils\common.py", line 36, in <module>
    from drf_yasg.inspectors import CoreAPICompatInspector, NotHandled
  File "C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\drf_yasg\inspectors\__init__.py", line 5, in <module>
    from .field import (
  File "C:\Users\some.user\Miniconda3\envs\label-studio\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'. Did you mean: 'BooleanField'?

Tried installing in two separate environments, using python’s default venv and using conda, both times same error occured.

To Reproduce:

  1. run pip install label-studio
  2. run label-studio

Environment (please complete the following information):

  • OS: Microsoft Windows 10
  • Label Studio Version: latest version from PyPi

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
nazebzuraticommented, Sep 22, 2022

It seems that drf_yasg package caused the error (reported here).

To temporarily fix the issue, …

  1. Go to your ‘drf_yasg’ package in your environment. In your case based on the error message, C:\Users\some.user\Miniconda3\envs\label-studio\lib\site-packages\drf_yasg.
  2. Open .\inspectors\field.py file and replace all ‘NullBooleanField’ to ‘BooleanField’.
  3. Restart label-studio by running the command label-studio.

This is only the workaround if you have urgent work to do. Use with care.

1reaction
makseqcommented, Dec 1, 2022

The problem is here:

Current platform is win32, apply sqlite fix Can’t load sqlite3.dll from current directory

You can download sqlite manually and place it in the directory where you run LS. Or you can use Anaconda Python, it has the correct SQLite lib inside.

x32 - https://www.sqlite.org/2022/sqlite-dll-win32-x86-3400000.zip x64 - https://www.sqlite.org/2022/sqlite-dll-win64-x64-3400000.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

Having issue in Installing label-studio via python 3.7
I am following the instructions from official site. # Requires >=Python3.6, <3.9 pip install label-studio # Start the server at http://localhost ...
Read more >
Label Studio Documentation — Install and Upgrade
Install with pip. To install Label Studio with pip and a virtual environment, you need Python version 3.7 or later. Run the following:...
Read more >
How to Setup Your Python Environment for Machine Learning ...
I have installed theano and tensorflow, while the errors pop out when installing keras. C:\Users\stevenwsy>pip install keras. Collecting keras
Read more >
using cached psycopg2-binary-2.9.3.tar.gz (380 kb) preparing ...
stdout) STDERR: I've also tried to use python toolchain.py pip install psycopg2 but get similar if not the ...
Read more >
AttributeError: module 'lib' has no attribute ... - Ask Ubuntu
... and Anaconda is running again.. Once in, I was able to upgrade PyOpenSSL from 19.0.0 to 22.0.0 from within Anaconda to update...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found