[GH-ISSUE #283] cannot import name 'six' from 'django.utils' #231

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

Originally created by @NovaMoon on GitHub (Jan 10, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/283

Trying to install Papermerge the bare metal way on my raspberry pi. when i installed everything according to the guide here https://papermerge.readthedocs.io/en/latest/setup/manual_way.html i get this.

./manage.py migrate
Traceback (most recent call last):
File "./manage.py", line 24, in
execute_from_command_line(sys.argv)
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/core/management/init.py", line 377, in execute
django.setup()
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/knox/models.py", line 5, in
from knox import crypto
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/knox/crypto.py", line 7, in
from knox.settings import CONSTANTS, knox_settings
File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/knox/settings.py", line 5, in
from rest_framework.settings import APISettings, api_settings
File "/home/pi/.local/lib/python3.7/site-packages/rest_framework/settings.py", line 27, in
from django.utils import six
ImportError: cannot import name 'six' from 'django.utils' (/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/utils/init.py)

Originally created by @NovaMoon on GitHub (Jan 10, 2021). Original GitHub issue: https://github.com/ciur/papermerge/issues/283 Trying to install Papermerge the bare metal way on my raspberry pi. when i installed everything according to the guide here https://papermerge.readthedocs.io/en/latest/setup/manual_way.html i get this. ./manage.py migrate Traceback (most recent call last): File "./manage.py", line 24, in <module> execute_from_command_line(sys.argv) File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute django.setup() File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate app_config.import_models() File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models self.models_module = import_module(models_module_name) File "/usr/lib/python3.7/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 "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/knox/models.py", line 5, in <module> from knox import crypto File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/knox/crypto.py", line 7, in <module> from knox.settings import CONSTANTS, knox_settings File "/home/pi/Papermerge/.venv/lib/python3.7/site-packages/knox/settings.py", line 5, in <module> from rest_framework.settings import APISettings, api_settings File "/home/pi/.local/lib/python3.7/site-packages/rest_framework/settings.py", line 27, in <module> from django.utils import six ImportError: cannot import name 'six' from 'django.utils' (/home/pi/Papermerge/.venv/lib/python3.7/site-packages/django/utils/__init__.py)
kerem 2026-02-25 21:31:29 +03:00
Author
Owner

@ciur commented on GitHub (Jan 10, 2021):

@NovaMoon
That guide you mentioned above is for Ubuntu 20.04 LTS or Debian compatible system.
I know that there are persons who successfully run Papermerge on raspberry pi.
This issue is definitely not a bug.

<!-- gh-comment-id:757543638 --> @ciur commented on GitHub (Jan 10, 2021): @NovaMoon That guide you mentioned above is for Ubuntu 20.04 LTS or Debian compatible system. I know that there are persons who successfully run Papermerge on raspberry pi. This issue is definitely not a bug.
Author
Owner

@francescocarzaniga commented on GitHub (Jan 11, 2021):

@NovaMoon You probably had installed Django's RestFramework previously on your Pi, so you are stuck with an old version incompatible with Django 3.1.
I would suggest removing your current Papermerge installation and following the tutorial again, running python3 -m venv .venv instead of python3 -m venv .venv --system-site-packages.
I believe this should be changed in the setup guide as well @ciur. There are very few reasons why a virtualenv should be initialised with system packages, and it usually causes more problems than it solves by summoning old cruft from the system.

<!-- gh-comment-id:757974725 --> @francescocarzaniga commented on GitHub (Jan 11, 2021): @NovaMoon You probably had installed Django's RestFramework previously on your Pi, so you are stuck with an old version incompatible with Django 3.1. I would suggest removing your current Papermerge installation and following the tutorial again, running `python3 -m venv .venv` instead of `python3 -m venv .venv --system-site-packages`. I believe this should be changed in the setup guide as well @ciur. There are very few reasons why a virtualenv should be initialised with system packages, and it usually causes more problems than it solves by summoning old cruft from the system.
Author
Owner

@NovaMoon commented on GitHub (Jan 11, 2021):

@NovaMoon You probably had installed Django's RestFramework previously on your Pi, so you are stuck with an old version incompatible with Django 3.1.
I would suggest removing your current Papermerge installation and following the tutorial again, running python3 -m venv .venv instead of python3 -m venv .venv --system-site-packages.
I believe this should be changed in the setup guide as well @ciur. There are very few reasons why a virtualenv should be initialised with system packages, and it usually causes more problems than it solves by summoning old cruft from the system.

this was the solution and everything works now. thanks a lot! i was indeed summoning old cruft.

<!-- gh-comment-id:758276854 --> @NovaMoon commented on GitHub (Jan 11, 2021): > > > @NovaMoon You probably had installed Django's RestFramework previously on your Pi, so you are stuck with an old version incompatible with Django 3.1. > I would suggest removing your current Papermerge installation and following the tutorial again, running `python3 -m venv .venv` instead of `python3 -m venv .venv --system-site-packages`. > I believe this should be changed in the setup guide as well @ciur. There are very few reasons why a virtualenv should be initialised with system packages, and it usually causes more problems than it solves by summoning old cruft from the system. this was the solution and everything works now. thanks a lot! i was indeed summoning old cruft.
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#231
No description provided.