[GH-ISSUE #345] ModuleNotFoundError: No module named 'mglib' #272

Closed
opened 2026-02-25 21:31:35 +03:00 by kerem · 4 comments
Owner

Originally created by @l4rm4nd on GitHub (Mar 12, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/345

Originally assigned to: @ciur on GitHub.

Newest papermerge release version 2.0.0rc48 does not properly run, because a Python packge called mglib is missing.

The cause might be some modifications of /requirements/base.txt

image

Logs:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 224, in fetch_command
    app_name = commands[subcommand]
KeyError: 'worker'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "./manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 231, in fetch_command
    settings.INSTALLED_APPS
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 69, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 170, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)


  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/app/papermerge/config/settings/production.py", line 1, in <module>
    from .base import *  # noqa
  File "/app/papermerge/config/settings/base.py", line 4, in <module>
    from mglib.utils import try_load_config
Originally created by @l4rm4nd on GitHub (Mar 12, 2021). Original GitHub issue: https://github.com/ciur/papermerge/issues/345 Originally assigned to: @ciur on GitHub. Newest papermerge [release version 2.0.0rc48](https://github.com/ciur/papermerge/releases/tag/v2.0.0rc48) does not properly run, because a Python packge called `mglib` is missing. The cause might be some modifications of ``/requirements/base.txt`` ![image](https://user-images.githubusercontent.com/21357789/110967427-a4c91600-8356-11eb-83cc-3eb57f406a6f.png) **Logs:** ```` Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 224, in fetch_command app_name = commands[subcommand] KeyError: 'worker' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./manage.py", line 24, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 231, in fetch_command settings.INSTALLED_APPS File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 82, in __getattr__ self._setup(name) File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 69, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python3.8/dist-packages/django/conf/__init__.py", line 170, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/app/papermerge/config/settings/production.py", line 1, in <module> from .base import * # noqa File "/app/papermerge/config/settings/base.py", line 4, in <module> from mglib.utils import try_load_config ````
kerem 2026-02-25 21:31:35 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@l4rm4nd commented on GitHub (Mar 12, 2021):

Manually installing mglib yields

ModuleNotFoundError: No module named 'rest_framework'

Guess various packages are currently not installed and missing.

<!-- gh-comment-id:797599231 --> @l4rm4nd commented on GitHub (Mar 12, 2021): Manually installing mglib yields ```` ModuleNotFoundError: No module named 'rest_framework' ```` Guess various packages are currently not installed and missing.
Author
Owner

@ciur commented on GitHub (Mar 12, 2021):

It is very strange. The mglib, rest_framework and other dependencies are listed as dependencies in papermerge-core's setup.py file.

How did you run that ? From withing docker image ? Manual installation ?
I've just checked, when installed in completely new python virtual environment:

$ pip install -r requiments/base.txt

will install all dependencies (base.txt contains only django dependency and papermerge-core).
Maybe you can provide more details about your environment setup: manual installation steps, or how you run docker image...

Wait a second, I see in logs:

/app/papermerge/config/settings/production.py

Is this linuxserver.io docker image ? I am asking, because in official docker image application is installed in /opt/papermerge/...

<!-- gh-comment-id:797614136 --> @ciur commented on GitHub (Mar 12, 2021): It is very strange. The mglib, rest_framework and other dependencies are listed as dependencies in papermerge-core's [setup.py file](https://github.com/papermerge/papermerge-core/blob/master/setup.py). How did you run that ? From withing docker image ? Manual installation ? I've just checked, when installed in completely new python virtual environment: ``` $ pip install -r requiments/base.txt ``` will install all dependencies (base.txt contains only django dependency and papermerge-core). Maybe you can provide more details about your environment setup: manual installation steps, or how you run docker image... Wait a second, I see in logs: ``` /app/papermerge/config/settings/production.py ``` Is this linuxserver.io docker image ? I am asking, because in official docker image application is installed in ``/opt/papermerge/...``
Author
Owner

@l4rm4nd commented on GitHub (Mar 12, 2021):

It is very strange. The mglib, rest_framework and other dependencies are listed as dependencies in papermerge-core's setup.py file.

How did you run that ? From withing docker image ? Manual installation ?
I've just checked, when installed in completely new python virtual environment:

$ pip install -r requiments/base.txt

will install all dependencies (base.txt contains only django dependency and papermerge-core).
Maybe you can provide more details about your environment setup: manual installation steps, or how you run docker image...

Wait a second, I see in logs:

/app/papermerge/config/settings/production.py

Is this linuxserver.io docker image ? I am asking, because in official docker image application is installed in /opt/papermerge/...

Yep sorry! This is the ARM docker image provided by linuxserver.io, running on my Raspberry Pi 4.

No special installation steps. Just pulling the newest image and running it with the same old configuration as the previous releases that always worked.

<!-- gh-comment-id:797619494 --> @l4rm4nd commented on GitHub (Mar 12, 2021): > > > It is very strange. The mglib, rest_framework and other dependencies are listed as dependencies in papermerge-core's [setup.py file](https://github.com/papermerge/papermerge-core/blob/master/setup.py). > > How did you run that ? From withing docker image ? Manual installation ? > I've just checked, when installed in completely new python virtual environment: > > ``` > $ pip install -r requiments/base.txt > ``` > > will install all dependencies (base.txt contains only django dependency and papermerge-core). > Maybe you can provide more details about your environment setup: manual installation steps, or how you run docker image... > > Wait a second, I see in logs: > > ``` > /app/papermerge/config/settings/production.py > ``` > > Is this linuxserver.io docker image ? I am asking, because in official docker image application is installed in `/opt/papermerge/...` Yep sorry! This is the ARM docker image provided by linuxserver.io, running on my Raspberry Pi 4. No special installation steps. Just pulling the newest image and running it with the same old configuration as the previous releases that always worked.
Author
Owner

@ciur commented on GitHub (Mar 12, 2021):

ah, then this is packaging issue, I mean linuxserver.io docker image issue.
There is very subtle change which I did which I guess might affect there way you need to build a docker image.
I will open a bug on their side and explain issue and what change they need to do in their Dockerfile.

You can close this bug.

<!-- gh-comment-id:797636844 --> @ciur commented on GitHub (Mar 12, 2021): ah, then this is packaging issue, I mean linuxserver.io docker image issue. There is very subtle change which I did which I guess might affect there way you need to build a docker image. I will open a bug on their side and explain issue and what change they need to do in their Dockerfile. You can close this bug.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#272
No description provided.