Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install using script on Debian 12 #8495

Open
2 of 7 tasks
mschaffner9239 opened this issue Nov 16, 2024 · 35 comments
Open
2 of 7 tasks

Cannot install using script on Debian 12 #8495

mschaffner9239 opened this issue Nov 16, 2024 · 35 comments
Labels
bug Identifies a bug which needs to be addressed installer question This is a question setup Relates to the InvenTree setup / installation process

Comments

@mschaffner9239
Copy link

Deployment Method

  • Installer
  • Docker Development
  • Docker Production
  • Bare metal Development
  • Bare metal Production
  • Digital Ocean image
  • Other (please provide a link Steps to Reproduce

Describe the problem*

Created a new Debian 12 VM and then run the installer script. Script fails at the point where it runs through the database creation.

Steps to Reproduce

  1. Create Debian 12 VM
  2. Run installer script

Believe the issue has to do with Debian 12 default installing Python 3.11.2

Relevant log output

root@invtest:/var/log/inventree# cat setup_2024-11-15_18_57_23.log 
# POI01| Importing functions
# POI01| Functions imported
# POI03| Setting base environment variables
# POI03| No config file found: /etc/inventree/config.yaml, using envs or defaults
# POI03| Collected environment variables:
# POI03|    INVENTREE_MEDIA_ROOT=/opt/inventree/data/media
# POI03|    INVENTREE_STATIC_ROOT=/opt/inventree/data/static
# POI03|    INVENTREE_BACKUP_DIR=/opt/inventree/data/backup
# POI03|    INVENTREE_PLUGINS_ENABLED=true
# POI03|    INVENTREE_PLUGIN_FILE=/etc/inventree/plugins.txt
# POI03|    INVENTREE_SECRET_KEY_FILE=/etc/inventree/secret_key.txt
# POI03|    INVENTREE_DB_ENGINE=sqlite3
# POI03|    INVENTREE_DB_NAME=/opt/inventree/data/database.sqlite3
# POI03|    INVENTREE_DB_USER=sampleuser
# POI03|    INVENTREE_DB_HOST=samplehost
# POI03|    INVENTREE_DB_PORT=123456
# POI04| Running in docker: no
# POI05| Using init command: systemctl
# POI06| Getting the IP address of the server via web service
# POI06| IP address is 47.154.159.22
# POI07| No python environment found - using environment variable: python3.9
# POI07| Trying to detecting python3.9 to python3.12 - using newest version
# POI07| Checking for python3.12
# POI07| Checking for python3.11
# POI07| Found python3.11 installed - using for setup python3.11
# POI07| Using python command: python3.11
# POI08| Checking if update checks are needed
# POI08| Normal install - no need for checks
# POI09| Setting up python environment
Collecting invoke
  Downloading invoke-2.2.0-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.3/160.3 kB 5.8 MB/s eta 0:00:00
Collecting wheel
  Downloading wheel-0.45.0-py3-none-any.whl (72 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.5/72.5 kB 10.4 MB/s eta 0:00:00
Installing collected packages: wheel, invoke
Successfully installed invoke-2.2.0 wheel-0.45.0
# POI09| Unlinking default nginx config\n# POI09| Old file still in /etc/nginx/sites-available/default
# POI09| Unlinked default nginx config
# POI09| Stopping nginx
# POI09| Stopped nginx
# POI09| Setting up nginx to /etc/nginx/sites-enabled/inventree.conf
# POI09| Starting nginx
# POI09| Started nginx
# POI09| (Re)creating init scripts
Created symlink /etc/systemd/system/multi-user.target.wants/inventree.service → /etc/systemd/system/inventree.service.
Created symlink /etc/systemd/system/inventree.service.wants/inventree-web.service → /etc/systemd/system/inventree-web.service.
Scaling up...
Created symlink /etc/systemd/system/inventree-web.service.wants/inventree-web-1.service → /etc/systemd/system/inventree-web-1.service.
--> done.
Created symlink /etc/systemd/system/inventree.service.wants/inventree-worker.service → /etc/systemd/system/inventree-worker.service.
Scaling up...
Created symlink /etc/systemd/system/inventree-worker.service.wants/inventree-worker-1.service → /etc/systemd/system/inventree-worker-1.service.
--> done.
# POI09| Enabling InvenTree on boot
# POI09| Enabled InvenTree on boot
# POI10| Creating admin user data
# POI11| Stopping InvenTree
# POI11| Stopped InvenTree
# POI12| Updating InvenTree
Collecting uv
  Downloading uv-0.5.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.2/14.2 MB 13.6 MB/s eta 0:00:00
Requirement already satisfied: wheel in ./env/lib/python3.11/site-packages (0.45.0)
Installing collected packages: uv
Successfully installed uv-0.5.2
Using Python 3.11.2 environment at env
Resolved 137 packages in 2.26s
Prepared 137 packages in 3.83s
Uninstalled 1 package in 16ms
Installed 137 packages in 211ms
 + asgiref==3.8.1
 + async-timeout==4.0.3
 + attrs==23.2.0
 + babel==2.15.0
 + bleach==6.1.0
 + brotli==1.1.0
 + certifi==2024.7.4
 + cffi==1.16.0
 + charset-normalizer==3.3.2
 + coreapi==2.3.3
 + coreschema==0.0.4
 + cryptography==42.0.8
 + cssselect2==0.7.0
 + defusedxml==0.7.1
 + deprecated==1.2.14
 + diff-match-patch==20230430
 + dj-rest-auth==6.0.0
 + django==4.2.15
 + django-allauth==0.63.3
 + django-allauth-2fa==0.11.1
 + django-cleanup==8.1.0
 + django-cors-headers==4.4.0
 + django-crispy-forms==1.14.0
 + django-dbbackup==4.1.0
 + django-error-report-2==0.4.2
 + django-filter==24.2
 + django-flags==5.0.13
 + django-formtools==2.5.1
 + django-ical==1.9.2
 + django-import-export==3.3.9
 + django-js-asset==2.2.0
 + django-maintenance-mode==0.21.1
 + django-markdownify==0.9.5
 + django-money==3.2.0
 + django-mptt==0.16.0
 + django-otp==1.5.0
 + django-picklefield==3.2
 + django-q-sentry==0.1.6
 + django-q2==1.6.2
 + django-recurrence==1.11.1
 + django-redis==5.4.0
 + django-sesame==3.2.2
 + django-sql-utils==0.7.0
 + django-sslserver==0.22
 + django-stdimage==6.0.2
 + django-taggit==5.0.1
 + django-user-sessions==2.0.0
 + django-weasyprint==2.3.0
 + django-xforwardedfor-middleware==2.0
 + djangorestframework==3.14.0
 + djangorestframework-simplejwt==5.3.1
 + drf-spectacular==0.27.2
 + dulwich==0.22.1
 + et-xmlfile==1.1.0
 + feedparser==6.0.11
 + fonttools==4.53.0
 + googleapis-common-protos==1.63.2
 + grpcio==1.64.1
 + gunicorn==22.0.0
 + html5lib==1.1
 + icalendar==5.0.13
 + idna==3.7
 + importlib-metadata==7.1.0
 + inflection==0.5.1
 + isodate==0.6.1
 + itypes==1.2.0
 + jinja2==3.1.4
 + jsonschema==4.22.0
 + jsonschema-specifications==2023.12.1
 + lxml==5.2.2
 + markdown==3.6
 + markuppy==1.14
 + markupsafe==2.1.5
 + odfpy==1.4.1
 + openpyxl==3.1.4
 + opentelemetry-api==1.25.0
 + opentelemetry-exporter-otlp==1.25.0
 + opentelemetry-exporter-otlp-proto-common==1.25.0
 + opentelemetry-exporter-otlp-proto-grpc==1.25.0
 + opentelemetry-exporter-otlp-proto-http==1.25.0
 + opentelemetry-instrumentation==0.46b0
 + opentelemetry-instrumentation-django==0.46b0
 + opentelemetry-instrumentation-redis==0.46b0
 + opentelemetry-instrumentation-requests==0.46b0
 + opentelemetry-instrumentation-wsgi==0.46b0
 + opentelemetry-proto==1.25.0
 + opentelemetry-sdk==1.25.0
 + opentelemetry-semantic-conventions==0.46b0
 + opentelemetry-util-http==0.46b0
 + packaging==24.1
 + pdf2image==1.17.0
 + pillow==10.3.0
 + pint==0.21
 + pip-licenses==4.4.0
 + prettytable==3.10.0
 + protobuf==4.25.3
 + py-moneyed==3.0
 + pycparser==2.22
 + pydyf==0.10.0
 + pyjwt==2.8.0
 + pyphen==0.15.0
 + pypng==0.20220715.0
 + python-barcode==0.15.1
 + python-dateutil==2.9.0.post0
 + python-dotenv==1.0.1
 + python-fsutil==0.14.1
 + python3-openid==3.2.0
 + python3-saml==1.16.0
 + pytz==2024.1
 + pyyaml==6.0.1
 + qrcode==7.4.2
 + rapidfuzz==3.9.3
 + redis==5.0.7
 + referencing==0.35.1
 + regex==2024.4.28
 + requests==2.32.3
 + rpds-py==0.18.1
 + sentry-sdk==2.8.0
 - setuptools==75.5.0
 + setuptools==72.1.0
 + sgmllib3k==1.0.0
 + six==1.16.0
 + sqlparse==0.5.0
 + tablib==3.5.0
 + tinycss2==1.2.1
 + typing-extensions==4.12.2
 + uritemplate==4.1.1
 + urllib3==2.2.2
 + wcwidth==0.2.13
 + weasyprint==61.2
 + webencodings==0.5.1
 + whitenoise==6.7.0
 + wrapt==1.16.0
 + xlrd==2.0.1
 + xlwt==1.3.0
 + xmlsec==1.3.14
 + zipp==3.19.2
 + zopfli==0.2.3
Plugin configuration file does not exist - creating default file
warning: Requirements file /etc/inventree/plugins.txt does not contain any dependencies
Using Python 3.11.2 environment at env
Audited in 2ms
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/config.py", line 178, in create
    mod = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/inventree/src/backend/InvenTree/plugin/__init__.py", line 4, in <module>
    from .plugin import InvenTreePlugin
  File "/opt/inventree/src/backend/InvenTree/plugin/plugin.py", line 16, in <module>
    from InvenTree.helpers import pui_url
  File "/opt/inventree/src/backend/InvenTree/InvenTree/helpers.py", line 26, in <module>
    import regex
  File "/opt/inventree/env/lib/python3.11/site-packages/regex/__init__.py", line 1, in <module>
    from .regex import *
  File "/opt/inventree/env/lib/python3.11/site-packages/regex/regex.py", line 417, in <module>
    import regex._regex_core as _regex_core
  File "/opt/inventree/env/lib/python3.11/site-packages/regex/_regex_core.py", line 21, in <module>
    import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'
# POI12| u | Installing required python packages from 'src/backend/requirements.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.2)
# POI12| u | Requirement already satisfied: setuptools in ./env/lib/python3.11/site-packages (66.1.1)
# POI12| u | Collecting setuptools
# POI12| u |   Downloading setuptools-75.5.0-py3-none-any.whl (1.2 MB)
# POI12| u |      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 10.2 MB/s eta 0:00:00
# POI12| u | Installing collected packages: setuptools
# POI12| u |   Attempting uninstall: setuptools
# POI12| u |     Found existing installation: setuptools 66.1.1
# POI12| u |     Uninstalling setuptools-66.1.1:
# POI12| u |       Successfully uninstalled setuptools-66.1.1
# POI12| u | Successfully installed setuptools-75.5.0
# POI12| u | Installing plugin packages from '/etc/inventree/plugins.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.2)
# POI12| u | Python version 3.11.2 - /opt/inventree/env/bin/python3
# POI12| u | InvenTree configuration file 'config.yaml' not found - creating default file
# POI12| u | Created config file /etc/inventree/config.yaml
# POI12| Set permissions for data dir and media: /opt/inventree/data
# POI13| Setting up InvenTree config values
# POI13| Writing the settings to the config file /etc/inventree/config.yaml
# POI13| Done setting up InvenTree config values
# POI14| Setting up InvenTree site URL
# POI15| Starting InvenTree
# POI15| Started InvenTree
# POI16| Printing Final message
####################################################################################
This InvenTree install uses nginx, the settings for the webserver can be found in
/etc/nginx/sites-enabled/inventree.conf
Try opening InvenTree with either
http://localhost/ or http://

Admin user data:
   Email: [email protected]
   Username: admin
   Password: 
####################################################################################
# POI17| Running postinstall script - done - Fri Nov 15 06:57:44 PM PST 2024
root@invtest:/var/log/inventree#
@mschaffner9239 mschaffner9239 added question This is a question setup Relates to the InvenTree setup / installation process triage:not-checked Item was not checked by the core team labels Nov 16, 2024
@SchrodingersGat
Copy link
Member

@matmair we have seen this "regex" error pop up a few times now.

This post seems to be related - mrabarnett/mrab-regex#413

@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed installer and removed triage:not-checked Item was not checked by the core team labels Nov 16, 2024
@matmair
Copy link
Member

matmair commented Nov 18, 2024

Not really sure why this is happening but it seems to happen across python projects; maybe we can try to remove regex?

@SchrodingersGat
Copy link
Member

root@invtest:/var/log/inventree# cat setup_2024-11-15_18_57_23.log

I would suggest:

a) Don't run this as root
b) Ensure you are working inside a virtual environment

I suspect that your python packages are getting some conflicts due to a) and b) above.

Start a clean install with a non-root venv and report back

@mschaffner9239
Copy link
Author

Hi,

I ran it under a non-root user and inside a Virtual Environment and had the same results.

Mike

@SchrodingersGat
Copy link
Member

Hmmm ok thanks for the information. Can you see what happens if you run python from the command line and try:

import regex

@mschaffner9239
Copy link
Author

Here is the result from the 'import regex'

(env) schaffner@invtest:~/inventree$ python
Python 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import regex
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'regex'
>>> 

@SchrodingersGat
Copy link
Member

Can you please also run (in the same venv):

which python

and then

python
>>> import sys
>>> print(sys.executable)

@mschaffner9239
Copy link
Author

Hi

Sorry for the delay, here is the information

(env) schaffner@invtest:~/inventree$ which python
/home/schaffner/inventree/env/bin/python
(env) schaffner@invtest:~/inventree$ 

(env) schaffner@invtest:~/inventree$ python
Python 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
/home/schaffner/inventree/env/bin/python
>>> 

@SchrodingersGat
Copy link
Member

That all looks as expected. Deeper into the rabbit hole.

Can you please run:

which invoke

And

invoke version 

@mschaffner9239
Copy link
Author

(env) root@invtest:/opt/inventree# which invoke
/opt/inventree/env/bin/invoke
(env) root@invtest:/opt/inventree# invoke --version
Invoke 2.2.0
(env) root@invtest:/opt/inventree# 

@SchrodingersGat
Copy link
Member

Sorry,

invoke version 

Not

invoke --version

@mschaffner9239
Copy link
Author

Sorry about that

(env) root@invtest:/opt/inventree# invoke version

InvenTree - inventree.org
The Open-Source Inventory Management System


Installation paths:
Base        /opt/inventree
Config      /opt/inventree/src/backend/InvenTree/config.yaml
Media       /opt/inventree/data/media
Static      /opt/inventree/data/static

Versions:
Python      3.11.2
Django      4.2.15
InvenTree   0.16.8
API         232
Node        N/A
Yarn        N/A

Commit hash: None
Commit date: None
(env) root@invtest:/opt/inventree# 

@SchrodingersGat
Copy link
Member

@mschaffner9239 ok, that all looks in order. We need to find out why your python installation seems to think it has regex installed but cannot access it, or is accessing from the wrong location?

Can you please run the following commands in order and see what the output is:

pip show regex
pip uninstall regex
pip install -U regex
pip show regex

@mschaffner9239
Copy link
Author

@SchrodingersGat , here are the results:

(env) root@invtest:/opt/inventree# pip show regex
Name: regex
Version: 2024.4.28
Summary: Alternative regular expression module, to replace re.
Home-page: https://github.com/mrabarnett/mrab-regex
Author: Matthew Barnett
Author-email: [email protected]
License: Apache Software License
Location: /opt/inventree/env/lib/python3.11/site-packages
Requires: 
Required-by: 
(env) root@invtest:/opt/inventree# pip uninstall regex
Found existing installation: regex 2024.4.28
Uninstalling regex-2024.4.28:
  Would remove:
    /opt/inventree/env/lib/python3.11/site-packages/regex-2024.4.28.dist-info/*
    /opt/inventree/env/lib/python3.11/site-packages/regex/*
Proceed (Y/n)? y
  Successfully uninstalled regex-2024.4.28
(env) root@invtest:/opt/inventree# pip install -U regex
Collecting regex
  Downloading regex-2024.11.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (792 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 792.7/792.7 kB 9.7 MB/s eta 0:00:00
Installing collected packages: regex
Successfully installed regex-2024.11.6
(env) root@invtest:/opt/inventree# pip show regex
Name: regex
Version: 2024.11.6
Summary: Alternative regular expression module, to replace re.
Home-page: https://github.com/mrabarnett/mrab-regex
Author: Matthew Barnett
Author-email: [email protected]
License: Apache Software License
Location: /opt/inventree/env/lib/python3.11/site-packages
Requires: 
Required-by: 
(env) root@invtest:/opt/inventree# 

@SchrodingersGat
Copy link
Member

Thanks, and does the installer run now?

@mschaffner9239
Copy link
Author

The install had already run so it won't run again, here is what I get:

schaffner@invtest:~$ sudo bash install.sh
[sudo] password for schaffner: 
### Installer for InvenTree - source: inventree/stable
### Detected distribution: Debian GNU/Linux 12
### Installing required packages for download
### Getting and adding key
### Adding package source
### Updating package lists
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://security.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]                             
Get:4 http://security.debian.org/debian-security bookworm-security/main Sources [128 kB]                        
Get:5 http://security.debian.org/debian-security bookworm-security/main amd64 Packages [205 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main Translation-en [126 kB]  
Get:7 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/debian 11 InRelease [1,857 B]               
Fetched 565 kB in 1s (551 kB/s)      
Reading package lists... Done
### Setting installer args
### Installing InvenTree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
inventree is already the newest version (0.16.8-1730959683.f23d4053.bullseye).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
### Install done!
schaffner@invtest:~$ 

@mschaffner9239
Copy link
Author

I just did an uninstall and then re-install and it appears to have removed the newer version of regex:

sudo bash install.sh 
### Installer for InvenTree - source: inventree/stable
### Detected distribution: Debian GNU/Linux 12
### Installing required packages for download
### Getting and adding key
### Adding package source
### Updating package lists
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                  
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease          
Get:4 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/debian 11 InRelease [1,857 B]
Fetched 1,857 B in 1s (1,652 B/s)
Reading package lists... Done
### Setting installer args
### Installing InvenTree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  inventree
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/72.9 MB of archives.
After this operation, 171 MB of additional disk space will be used.
Selecting previously unselected package inventree.
(Reading database ... 42335 files and directories currently installed.)
Preparing to unpack .../inventree_0.16.8-1730959683.f23d4053.bullseye_amd64.deb ...
# PRI01| Running preinstall script - start - Sun Nov 24 12:37:20 PM PST 2024
# PRI02| Clearing precompiled files - skipping
# PRI03| Running preinstall script - done - Sun Nov 24 12:37:20 PM PST 2024
Unpacking inventree (0.16.8-1730959683.f23d4053.bullseye) ...
Setting up inventree (0.16.8-1730959683.f23d4053.bullseye) ...
# POI01| Running postinstall script - start - Sun Nov 24 12:37:22 PM PST 2024
# POI01| Importing functions
# POI01| Functions imported
# POI03| Setting base environment variables
# POI03| Using existing config file: /etc/inventree/config.yaml
# POI03| Installing requirements
# POI03| Installed requirements
# POI03| Collected environment variables:
# POI03|    INVENTREE_MEDIA_ROOT=/opt/inventree/data/media
# POI03|    INVENTREE_STATIC_ROOT=/opt/inventree/data/static
# POI03|    INVENTREE_BACKUP_DIR=/opt/inventree/data/backup
# POI03|    INVENTREE_PLUGINS_ENABLED=true
# POI03|    INVENTREE_PLUGIN_FILE=/etc/inventree/plugins.txt
# POI03|    INVENTREE_SECRET_KEY_FILE=/etc/inventree/secret_key.txt
# POI03|    INVENTREE_DB_ENGINE=sqlite3
# POI03|    INVENTREE_DB_NAME=/opt/inventree/data/database.sqlite3
# POI03|    INVENTREE_DB_USER=sampleuser
# POI03|    INVENTREE_DB_HOST=samplehost
# POI03|    INVENTREE_DB_PORT=123456
# POI04| Running in docker: no
# POI05| Using init command: systemctl
# POI06| Getting the IP address of the server via web service
# POI06| IP address is 
# POI07| Python environment already present
# POI07| Found earlier used version: /opt/inventree/env/bin/python
# POI07| Using python command: /opt/inventree/env/bin/python
# POI08| Checking if update checks are needed
# POI08| Running upgrade
# POI08| Old version is: 0.16.8-1730959683.f23d4053.bullseye | 16 - updating to 0.16.8-1730959683.f23d4053.bullseye | 16
# POI09| Setting up python environment
Requirement already satisfied: invoke in ./env/lib/python3.11/site-packages (2.2.0)
Requirement already satisfied: wheel in ./env/lib/python3.11/site-packages (0.45.1)
# POI09| Stopping nginx
# POI09| Stopped nginx
# POI09| Setting up nginx to /etc/nginx/sites-enabled/inventree.conf
# POI09| Starting nginx
# POI09| Started nginx
# POI09| (Re)creating init scripts
Nothing to do.
Nothing to do.
# POI09| Enabling InvenTree on boot
# POI09| Enabled InvenTree on boot
# POI10| Admin data already exists - skipping
# POI11| Stopping InvenTree
# POI11| Stopped InvenTree
# POI12| Updating InvenTree
Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.4)
Requirement already satisfied: wheel in ./env/lib/python3.11/site-packages (0.45.1)
Using Python 3.11.2 environment at env
Resolved 137 packages in 357ms
Prepared 2 packages in 0.55ms
Uninstalled 2 packages in 14ms
Installed 2 packages in 8ms
 - regex==2024.11.6
 + regex==2024.4.28
 - setuptools==75.6.0
 + setuptools==72.1.0
warning: Requirements file /etc/inventree/plugins.txt does not contain any dependencies
Using Python 3.11.2 environment at env
Audited in 2ms
2024-11-24 12:37:38,306 ERROR No CSRF_TRUSTED_ORIGINS specified. Please provide a list of trusted origins, or specify INVENTREE_SITE_URL
# POI12| u | Installing required python packages from 'src/backend/requirements.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.4)
# POI12| u | Requirement already satisfied: setuptools in ./env/lib/python3.11/site-packages (72.1.0)
# POI12| u | Collecting setuptools
# POI12| u |   Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
# POI12| u |      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 10.7 MB/s eta 0:00:00
# POI12| u | Installing collected packages: setuptools
# POI12| u |   Attempting uninstall: setuptools
# POI12| u |     Found existing installation: setuptools 72.1.0
# POI12| u |     Uninstalling setuptools-72.1.0:
# POI12| u |       Successfully uninstalled setuptools-72.1.0
# POI12| u | Successfully installed setuptools-75.6.0
# POI12| u | Installing plugin packages from '/etc/inventree/plugins.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.4)
# POI12| u | Python version 3.11.2 - /opt/inventree/env/bin/python3
# POI12| Set permissions for data dir and media: /opt/inventree/data
# POI14| Site URL already set - skipping
# POI15| Starting InvenTree
# POI15| Started InvenTree
# POI16| Printing Final message
####################################################################################
This InvenTree install uses nginx, the settings for the webserver can be found in
/etc/nginx/sites-enabled/inventree.conf
Try opening InvenTree with either
http://localhost/ or http:

Admin user data:
   Email: 
   Username: 
   Password: 
####################################################################################
# POI17| Running postinstall script - done - Sun Nov 24 12:37:38 PM PST 2024
### Install done!
schaffner@invtest:~$ 

@SchrodingersGat
Copy link
Member

Does the server run now then?

@mschaffner9239
Copy link
Author

Nope the server is not running, I think because the database has not been initialized, which is where it is failing during the Install script when it is first run.

@SchrodingersGat
Copy link
Member

@mschaffner9239 ok, then can you try running the following command?

inventree run invoke update --skip-backup

@mschaffner9239
Copy link
Author

Here is the results:

(env) root@invtest:/opt/inventree# inventree run invoke update --skip-backup

Installing required python packages from 'src/backend/requirements.txt'
Requirement already satisfied: pip in ./env/lib/python3.11/site-packages (23.0.1)
Collecting pip
  Downloading pip-24.3.1-py3-none-any.whl (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 12.1 MB/s eta 0:00:00
Requirement already satisfied: setuptools in ./env/lib/python3.11/site-packages (72.1.0)
Collecting setuptools
  Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 13.9 MB/s eta 0:00:00
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 72.1.0
    Uninstalling setuptools-72.1.0:
      Successfully uninstalled setuptools-72.1.0
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-24.3.1 setuptools-75.6.0
Requirement already satisfied: asgiref==3.8.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 3)) (3.8.1)
Requirement already satisfied: async-timeout==4.0.3 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 9)) (4.0.3)
Requirement already satisfied: attrs==23.2.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 13)) (23.2.0)
Requirement already satisfied: babel==2.15.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 19)) (2.15.0)
Requirement already satisfied: bleach==6.1.0 in ./env/lib/python3.11/site-packages (from bleach[css]==6.1.0->-r src/backend/requirements.txt (line 23)) (6.1.0)
Requirement already satisfied: brotli==1.1.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 27)) (1.1.0)
Requirement already satisfied: certifi==2024.7.4 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 112)) (2024.7.4)
Requirement already satisfied: cffi==1.16.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 118)) (1.16.0)
Requirement already satisfied: charset-normalizer==3.3.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 174)) (3.3.2)
Requirement already satisfied: coreapi==2.3.3 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 266)) (2.3.3)
Requirement already satisfied: coreschema==0.0.4 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 270)) (0.0.4)
Requirement already satisfied: cryptography==42.0.8 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 274)) (42.0.8)
Requirement already satisfied: cssselect2==0.7.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 310)) (0.7.0)
Requirement already satisfied: defusedxml==0.7.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 314)) (0.7.1)
Requirement already satisfied: deprecated==1.2.14 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 320)) (1.2.14)
Requirement already satisfied: diff-match-patch==20230430 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 327)) (20230430)
Requirement already satisfied: dj-rest-auth==6.0.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 331)) (6.0.0)
Requirement already satisfied: django==4.2.15 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 334)) (4.2.15)
Requirement already satisfied: django-allauth==0.63.3 in ./env/lib/python3.11/site-packages (from django-allauth[openid,saml]==0.63.3->-r src/backend/requirements.txt (line 369)) (0.63.3)
Requirement already satisfied: django-allauth-2fa==0.11.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 374)) (0.11.1)
Requirement already satisfied: django-cleanup==8.1.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 378)) (8.1.0)
Requirement already satisfied: django-cors-headers==4.4.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 382)) (4.4.0)
Requirement already satisfied: django-crispy-forms==1.14.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 386)) (1.14.0)
Requirement already satisfied: django-dbbackup==4.1.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 390)) (4.1.0)
Requirement already satisfied: django-error-report-2==0.4.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 394)) (0.4.2)
Requirement already satisfied: django-filter==24.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 398)) (24.2)
Requirement already satisfied: django-flags==5.0.13 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 402)) (5.0.13)
Requirement already satisfied: django-formtools==2.5.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 406)) (2.5.1)
Requirement already satisfied: django-ical==1.9.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 410)) (1.9.2)
Requirement already satisfied: django-import-export==3.3.9 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 414)) (3.3.9)
Requirement already satisfied: django-js-asset==2.2.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 418)) (2.2.0)
Requirement already satisfied: django-maintenance-mode==0.21.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 422)) (0.21.1)
Requirement already satisfied: django-markdownify==0.9.5 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 426)) (0.9.5)
Requirement already satisfied: django-money==3.2.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 430)) (3.2.0)
Requirement already satisfied: django-mptt==0.16.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 434)) (0.16.0)
Requirement already satisfied: django-otp==1.5.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 438)) (1.5.0)
Requirement already satisfied: django-picklefield==3.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 442)) (3.2)
Requirement already satisfied: django-q-sentry==0.1.6 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 446)) (0.1.6)
Requirement already satisfied: django-q2==1.6.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 449)) (1.6.2)
Requirement already satisfied: django-recurrence==1.11.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 453)) (1.11.1)
Requirement already satisfied: django-redis==5.4.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 457)) (5.4.0)
Requirement already satisfied: django-sesame==3.2.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 461)) (3.2.2)
Requirement already satisfied: django-sql-utils==0.7.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 465)) (0.7.0)
Requirement already satisfied: django-sslserver==0.22 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 469)) (0.22)
Requirement already satisfied: django-stdimage==6.0.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 472)) (6.0.2)
Requirement already satisfied: django-taggit==5.0.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 476)) (5.0.1)
Requirement already satisfied: django-user-sessions==2.0.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 480)) (2.0.0)
Requirement already satisfied: django-weasyprint==2.3.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 484)) (2.3.0)
Requirement already satisfied: django-xforwardedfor-middleware==2.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 488)) (2.0)
Requirement already satisfied: djangorestframework==3.14.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 491)) (3.14.0)
Requirement already satisfied: djangorestframework-simplejwt==5.3.1 in ./env/lib/python3.11/site-packages (from djangorestframework-simplejwt[crypto]==5.3.1->-r src/backend/requirements.txt (line 499)) (5.3.1)
Requirement already satisfied: drf-spectacular==0.27.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 503)) (0.27.2)
Requirement already satisfied: dulwich==0.22.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 507)) (0.22.1)
Requirement already satisfied: et-xmlfile==1.1.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 556)) (1.1.0)
Requirement already satisfied: feedparser==6.0.11 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 560)) (6.0.11)
Requirement already satisfied: fonttools==4.53.0 in ./env/lib/python3.11/site-packages (from fonttools[woff]==4.53.0->-r src/backend/requirements.txt (line 564)) (4.53.0)
Requirement already satisfied: googleapis-common-protos==1.63.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 608)) (1.63.2)
Requirement already satisfied: grpcio==1.64.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 614)) (1.64.1)
Requirement already satisfied: gunicorn==22.0.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 664)) (22.0.0)
Requirement already satisfied: html5lib==1.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 668)) (1.1)
Requirement already satisfied: icalendar==5.0.13 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 672)) (5.0.13)
Requirement already satisfied: idna==3.7 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 676)) (3.7)
Requirement already satisfied: importlib-metadata==7.1.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 680)) (7.1.0)
Requirement already satisfied: inflection==0.5.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 687)) (0.5.1)
Requirement already satisfied: isodate==0.6.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 691)) (0.6.1)
Requirement already satisfied: itypes==1.2.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 695)) (1.2.0)
Requirement already satisfied: jinja2==3.1.4 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 699)) (3.1.4)
Requirement already satisfied: jsonschema==4.22.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 703)) (4.22.0)
Requirement already satisfied: jsonschema-specifications==2023.12.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 707)) (2023.12.1)
Requirement already satisfied: lxml==5.2.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 711)) (5.2.2)
Requirement already satisfied: markdown==3.6 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 857)) (3.6)
Requirement already satisfied: markuppy==1.14 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 861)) (1.14)
Requirement already satisfied: markupsafe==2.1.5 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 864)) (2.1.5)
Requirement already satisfied: odfpy==1.4.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 926)) (1.4.1)
Requirement already satisfied: openpyxl==3.1.4 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 929)) (3.1.4)
Requirement already satisfied: opentelemetry-api==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 933)) (1.25.0)
Requirement already satisfied: opentelemetry-exporter-otlp==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 947)) (1.25.0)
Requirement already satisfied: opentelemetry-exporter-otlp-proto-common==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 951)) (1.25.0)
Requirement already satisfied: opentelemetry-exporter-otlp-proto-grpc==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 957)) (1.25.0)
Requirement already satisfied: opentelemetry-exporter-otlp-proto-http==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 961)) (1.25.0)
Requirement already satisfied: opentelemetry-instrumentation==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 965)) (0.46b0)
Requirement already satisfied: opentelemetry-instrumentation-django==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 973)) (0.46b0)
Requirement already satisfied: opentelemetry-instrumentation-redis==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 977)) (0.46b0)
Requirement already satisfied: opentelemetry-instrumentation-requests==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 981)) (0.46b0)
Requirement already satisfied: opentelemetry-instrumentation-wsgi==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 985)) (0.46b0)
Requirement already satisfied: opentelemetry-proto==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 989)) (1.25.0)
Requirement already satisfied: opentelemetry-sdk==1.25.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 996)) (1.25.0)
Requirement already satisfied: opentelemetry-semantic-conventions==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1003)) (0.46b0)
Requirement already satisfied: opentelemetry-util-http==0.46b0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1012)) (0.46b0)
Requirement already satisfied: packaging==24.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1019)) (24.1)
Requirement already satisfied: pdf2image==1.17.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1023)) (1.17.0)
Requirement already satisfied: pillow==10.3.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1027)) (10.3.0)
Requirement already satisfied: pint==0.21 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1104)) (0.21)
Requirement already satisfied: pip-licenses==4.4.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1108)) (4.4.0)
Requirement already satisfied: prettytable==3.10.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1112)) (3.10.0)
Requirement already satisfied: protobuf==4.25.3 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1116)) (4.25.3)
Requirement already satisfied: py-moneyed==3.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1131)) (3.0)
Requirement already satisfied: pycparser==2.22 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1135)) (2.22)
Requirement already satisfied: pydyf==0.10.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1139)) (0.10.0)
Requirement already satisfied: pyjwt==2.8.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1143)) (2.8.0)
Requirement already satisfied: pyphen==0.15.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1147)) (0.15.0)
Requirement already satisfied: pypng==0.20220715.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1151)) (0.20220715.0)
Requirement already satisfied: python-barcode==0.15.1 in ./env/lib/python3.11/site-packages (from python-barcode[images]==0.15.1->-r src/backend/requirements.txt (line 1155)) (0.15.1)
Requirement already satisfied: python-dateutil==2.9.0.post0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1159)) (2.9.0.post0)
Requirement already satisfied: python-dotenv==1.0.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1165)) (1.0.1)
Requirement already satisfied: python-fsutil==0.14.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1169)) (0.14.1)
Requirement already satisfied: python3-openid==3.2.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1173)) (3.2.0)
Requirement already satisfied: python3-saml==1.16.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1177)) (1.16.0)
Requirement already satisfied: pytz==2024.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1182)) (2024.1)
Requirement already satisfied: pyyaml==6.0.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1189)) (6.0.1)
Requirement already satisfied: qrcode==7.4.2 in ./env/lib/python3.11/site-packages (from qrcode[pil]==7.4.2->-r src/backend/requirements.txt (line 1245)) (7.4.2)
Requirement already satisfied: rapidfuzz==3.9.3 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1251)) (3.9.3)
Requirement already satisfied: redis==5.0.7 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1346)) (5.0.7)
Requirement already satisfied: referencing==0.35.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1350)) (0.35.1)
Requirement already satisfied: regex==2024.4.28 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1356)) (2024.4.28)
Requirement already satisfied: requests==2.32.3 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1437)) (2.32.3)
Requirement already satisfied: rpds-py==0.18.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1443)) (0.18.1)
Requirement already satisfied: sentry-sdk==2.8.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1546)) (2.8.0)
Collecting setuptools==72.1.0 (from -r src/backend/requirements.txt (line 1552))
  Downloading setuptools-72.1.0-py3-none-any.whl (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 12.5 MB/s eta 0:00:00
Requirement already satisfied: sgmllib3k==1.0.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1559)) (1.0.0)
Requirement already satisfied: six==1.16.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1562)) (1.16.0)
Requirement already satisfied: sqlparse==0.5.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1570)) (0.5.0)
Requirement already satisfied: tablib==3.5.0 in ./env/lib/python3.11/site-packages (from tablib[html,ods,xls,xlsx,yaml]==3.5.0->-r src/backend/requirements.txt (line 1576)) (3.5.0)
Requirement already satisfied: tinycss2==1.2.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1582)) (1.2.1)
Requirement already satisfied: typing-extensions==4.12.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1589)) (4.12.2)
Requirement already satisfied: uritemplate==4.1.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1598)) (4.1.1)
Requirement already satisfied: urllib3==2.2.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1604)) (2.2.2)
Requirement already satisfied: wcwidth==0.2.13 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1611)) (0.2.13)
Requirement already satisfied: weasyprint==61.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1615)) (61.2)
Requirement already satisfied: webencodings==0.5.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1621)) (0.5.1)
Requirement already satisfied: whitenoise==6.7.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1629)) (6.7.0)
Requirement already satisfied: wrapt==1.16.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1633)) (1.16.0)
Requirement already satisfied: xlrd==2.0.1 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1708)) (2.0.1)
Requirement already satisfied: xlwt==1.3.0 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1712)) (1.3.0)
Requirement already satisfied: xmlsec==1.3.14 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1716)) (1.3.14)
Requirement already satisfied: zipp==3.19.2 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1776)) (3.19.2)
Requirement already satisfied: zopfli==0.2.3 in ./env/lib/python3.11/site-packages (from -r src/backend/requirements.txt (line 1780)) (0.2.3)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 75.6.0
    Uninstalling setuptools-75.6.0:
      Successfully uninstalled setuptools-75.6.0
Successfully installed setuptools-72.1.0
Installing plugin packages from '/etc/inventree/plugins.txt'
Python version 3.11.2 - /opt/inventree/env/bin/python3
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/config.py", line 178, in create
    mod = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/inventree/src/backend/InvenTree/plugin/__init__.py", line 4, in <module>
    from .plugin import InvenTreePlugin
  File "/opt/inventree/src/backend/InvenTree/plugin/plugin.py", line 16, in <module>
    from InvenTree.helpers import pui_url
  File "/opt/inventree/src/backend/InvenTree/InvenTree/helpers.py", line 26, in <module>
    import regex
  File "/opt/inventree/env/lib/python3.11/site-packages/regex/__init__.py", line 1, in <module>
    from .regex import *
  File "/opt/inventree/env/lib/python3.11/site-packages/regex/regex.py", line 417, in <module>
    import regex._regex_core as _regex_core
  File "/opt/inventree/env/lib/python3.11/site-packages/regex/_regex_core.py", line 21, in <module>
    import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'
(env) root@invtest:/opt/inventree# 

@SchrodingersGat
Copy link
Member

Ok, that's super frustrating...

To determine if the old version of regex is the issue, try:

pip install -U regex
inventree run invoke migrate

@mschaffner9239
Copy link
Author

The Regex update was successful, but when trying to run the migrate, it failed:

(env) root@invtest:/opt/inventree# inventree run invoke migrate

Running InvenTree database migrations...
========================================
Python version 3.11.2 - /opt/inventree/env/bin/python3
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/config.py", line 178, in create
    mod = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/inventree/src/backend/InvenTree/plugin/__init__.py", line 4, in <module>
    from .plugin import InvenTreePlugin
  File "/opt/inventree/src/backend/InvenTree/plugin/plugin.py", line 16, in <module>
    from InvenTree.helpers import pui_url
  File "/opt/inventree/src/backend/InvenTree/InvenTree/helpers.py", line 29, in <module>
    from PIL import Image
  File "/opt/inventree/env/lib/python3.11/site-packages/PIL/Image.py", line 88, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/opt/inventree/env/lib/python3.11/site-packages/PIL/__init__.py)
(env) root@invtest:/opt/inventree# 

@matmair
Copy link
Member

matmair commented Nov 25, 2024

@SchrodingersGat we are using regex only in InvenTree/helpers.py - maybe we can replace it?

@SchrodingersGat
Copy link
Member

we are using regex only in InvenTree/helpers.py - maybe we can replace it?

Potentially - although I do not think that gets us closer to understanding what is happening here.

@JamieSinn
Copy link

I also get the same import error on attempting to install (same issue as #8494 ) -

root@inventree:/opt/inventree/src/backend/InvenTree# inventree run invoke migrate

Running InvenTree database migrations...
========================================
Python version 3.10.12 - /opt/inventree/env/bin/python3
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/inventree/env/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/inventree/env/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/opt/inventree/env/lib/python3.10/site-packages/django/apps/config.py", line 178, in create
    mod = import_module(mod_path)
  File "/usr/lib/python3.10/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 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  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 "/opt/inventree/src/backend/InvenTree/plugin/__init__.py", line 4, in <module>
    from .plugin import InvenTreePlugin
  File "/opt/inventree/src/backend/InvenTree/plugin/plugin.py", line 16, in <module>
    from InvenTree.helpers import pui_url
  File "/opt/inventree/src/backend/InvenTree/InvenTree/helpers.py", line 29, in <module>
    from PIL import Image
  File "/opt/inventree/env/lib/python3.10/site-packages/PIL/Image.py", line 88, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/opt/inventree/env/lib/python3.10/site-packages/PIL/__init__.py)

@JamieSinn
Copy link

This install log may be helpful too - #8494 (comment)

@SchrodingersGat
Copy link
Member

All, I have just release 0.16.9 which should hopefully address these issues - please try the new version and report back

@mschaffner9239
Copy link
Author

Just bringing over the attempted install on Debian 12 with version 0.16.9

Setting up inventree (0.16.9-1732958900.e0756a70.bullseye) ...
# POI01| Running postinstall script - start - Sat Nov 30 02:46:40 PM PST 2024
# POI01| Importing functions
# POI01| Functions imported
# POI03| Setting base environment variables
# POI03| No config file found: /etc/inventree/config.yaml, using envs or defaults
# POI03| Collected environment variables:
# POI03|    INVENTREE_MEDIA_ROOT=/opt/inventree/data/media
# POI03|    INVENTREE_STATIC_ROOT=/opt/inventree/data/static
# POI03|    INVENTREE_BACKUP_DIR=/opt/inventree/data/backup
# POI03|    INVENTREE_PLUGINS_ENABLED=true
# POI03|    INVENTREE_PLUGIN_FILE=/etc/inventree/plugins.txt
# POI03|    INVENTREE_SECRET_KEY_FILE=/etc/inventree/secret_key.txt
# POI03|    INVENTREE_DB_ENGINE=sqlite3
# POI03|    INVENTREE_DB_NAME=/opt/inventree/data/database.sqlite3
# POI03|    INVENTREE_DB_USER=sampleuser
# POI03|    INVENTREE_DB_HOST=samplehost
# POI03|    INVENTREE_DB_PORT=123456
# POI04| Running in docker: no
# POI05| Using init command: systemctl
# POI06| Getting the IP address of the server via web service
# POI06| IP address is 47.154.159.22
# POI07| No python environment found - using environment variable: python3.9
# POI07| Trying to detecting python3.9 to python3.12 - using newest version
# POI07| Checking for python3.12
# POI07| Checking for python3.11
# POI07| Found python3.11 installed - using for setup python3.11
# POI07| Using python command: python3.11
# POI08| Checking if update checks are needed
# POI08| Normal install - no need for checks
# POI09| Setting up python environment
Collecting invoke
  Downloading invoke-2.2.0-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.3/160.3 kB 3.8 MB/s eta 0:00:00
Collecting wheel
  Downloading wheel-0.45.1-py3-none-any.whl (72 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.5/72.5 kB 3.1 MB/s eta 0:00:00
Installing collected packages: wheel, invoke
Successfully installed invoke-2.2.0 wheel-0.45.1
# POI09| Unlinking default nginx config\n# POI09| Old file still in /etc/nginx/sites-available/default
# POI09| Unlinked default nginx config
# POI09| Stopping nginx
# POI09| Stopped nginx
# POI09| Setting up nginx to /etc/nginx/sites-enabled/inventree.conf
# POI09| Starting nginx
# POI09| Started nginx
# POI09| (Re)creating init scripts
Created symlink /etc/systemd/system/multi-user.target.wants/inventree.service → /etc/systemd/system/inventree.service.
Created symlink /etc/systemd/system/inventree.service.wants/inventree-web.service → /etc/systemd/system/inventree-web.service.
Scaling up...
Created symlink /etc/systemd/system/inventree-web.service.wants/inventree-web-1.service → /etc/systemd/system/inventree-web-1.service.
--> done.
Created symlink /etc/systemd/system/inventree.service.wants/inventree-worker.service → /etc/systemd/system/inventree-worker.service.
Scaling up...
Created symlink /etc/systemd/system/inventree-worker.service.wants/inventree-worker-1.service → /etc/systemd/system/inventree-worker-1.service.
--> done.
# POI09| Enabling InvenTree on boot
# POI09| Enabled InvenTree on boot
# POI10| Creating admin user data
# POI11| Stopping InvenTree
# POI11| Stopped InvenTree
# POI12| Updating InvenTree
Collecting uv
  Downloading uv-0.5.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.4/14.4 MB 6.0 MB/s eta 0:00:00
Requirement already satisfied: wheel in ./env/lib/python3.11/site-packages (0.45.1)
Installing collected packages: uv
Successfully installed uv-0.5.5
Using Python 3.11.2 environment at: env
Resolved 136 packages in 2.60s
Prepared 136 packages in 6.55s
Uninstalled 1 package in 18ms
Installed 136 packages in 2.83s
 + asgiref==3.8.1
 + async-timeout==5.0.1
 + attrs==23.2.0
 + babel==2.15.0
 + bleach==6.1.0
 + brotli==1.1.0
 + certifi==2024.7.4
 + cffi==1.16.0
 + charset-normalizer==3.3.2
 + coreapi==2.3.3
 + coreschema==0.0.4
 + cryptography==42.0.8
 + cssselect2==0.7.0
 + defusedxml==0.7.1
 + deprecated==1.2.14
 + diff-match-patch==20230430
 + dj-rest-auth==6.0.0
 + django==4.2.15
 + django-allauth==0.63.3
 + django-allauth-2fa==0.11.1
 + django-cleanup==8.1.0
 + django-cors-headers==4.4.0
 + django-crispy-forms==1.14.0
 + django-dbbackup==4.1.0
 + django-error-report-2==0.4.2
 + django-filter==24.2
 + django-flags==5.0.13
 + django-formtools==2.5.1
 + django-ical==1.9.2
 + django-import-export==3.3.9
 + django-js-asset==2.2.0
 + django-maintenance-mode==0.21.1
 + django-markdownify==0.9.5
 + django-money==3.2.0
 + django-mptt==0.16.0
 + django-otp==1.5.0
 + django-picklefield==3.2
 + django-q-sentry==0.1.6
 + django-q2==1.6.2
 + django-recurrence==1.11.1
 + django-redis==5.4.0
 + django-sesame==3.2.2
 + django-sql-utils==0.7.0
 + django-sslserver==0.22
 + django-stdimage==6.0.2
 + django-taggit==5.0.1
 + django-user-sessions==2.0.0
 + django-weasyprint==2.3.0
 + django-xforwardedfor-middleware==2.0
 + djangorestframework==3.14.0
 + djangorestframework-simplejwt==5.3.1
 + drf-spectacular==0.27.2
 + dulwich==0.22.1
 + et-xmlfile==1.1.0
 + feedparser==6.0.11
 + fonttools==4.53.0
 + googleapis-common-protos==1.63.2
 + grpcio==1.64.1
 + gunicorn==22.0.0
 + html5lib==1.1
 + icalendar==5.0.13
 + idna==3.7
 + importlib-metadata==7.1.0
 + inflection==0.5.1
 + isodate==0.6.1
 + itypes==1.2.0
 + jinja2==3.1.4
 + jsonschema==4.22.0
 + jsonschema-specifications==2023.12.1
 + lxml==5.2.2
 + markdown==3.6
 + markuppy==1.14
 + markupsafe==2.1.5
 + odfpy==1.4.1
 + openpyxl==3.1.4
 + opentelemetry-api==1.25.0
 + opentelemetry-exporter-otlp==1.25.0
 + opentelemetry-exporter-otlp-proto-common==1.25.0
 + opentelemetry-exporter-otlp-proto-grpc==1.25.0
 + opentelemetry-exporter-otlp-proto-http==1.25.0
 + opentelemetry-instrumentation==0.46b0
 + opentelemetry-instrumentation-django==0.46b0
 + opentelemetry-instrumentation-redis==0.46b0
 + opentelemetry-instrumentation-requests==0.46b0
 + opentelemetry-instrumentation-wsgi==0.46b0
 + opentelemetry-proto==1.25.0
 + opentelemetry-sdk==1.25.0
 + opentelemetry-semantic-conventions==0.46b0
 + opentelemetry-util-http==0.46b0
 + packaging==24.1
 + pdf2image==1.17.0
 + pillow==10.3.0
 + pint==0.21
 + pip-licenses==4.4.0
 + prettytable==3.10.0
 + protobuf==4.25.3
 + py-moneyed==3.0
 + pycparser==2.22
 + pydyf==0.10.0
 + pyjwt==2.8.0
 + pyphen==0.15.0
 + pypng==0.20220715.0
 + python-barcode==0.15.1
 + python-dateutil==2.9.0.post0
 + python-dotenv==1.0.1
 + python-fsutil==0.14.1
 + python3-openid==3.2.0
 + python3-saml==1.16.0
 + pytz==2024.1
 + pyyaml==6.0.1
 + qrcode==7.4.2
 + rapidfuzz==3.9.3
 + redis==5.0.7
 + referencing==0.35.1
 + requests==2.32.3
 + rpds-py==0.18.1
 + sentry-sdk==2.8.0
 - setuptools==75.6.0
 + setuptools==72.1.0
 + sgmllib3k==1.0.0
 + six==1.16.0
 + sqlparse==0.5.0
 + tablib==3.5.0
 + tinycss2==1.2.1
 + typing-extensions==4.12.2
 + uritemplate==4.1.1
 + urllib3==2.2.2
 + wcwidth==0.2.13
 + weasyprint==61.2
 + webencodings==0.5.1
 + whitenoise==6.7.0
 + wrapt==1.16.0
 + xlrd==2.0.1
 + xlwt==1.3.0
 + xmlsec==1.3.14
 + zipp==3.19.2
 + zopfli==0.2.3
Plugin configuration file does not exist - creating default file
warning: Requirements file `/etc/inventree/plugins.txt` does not contain any dependencies
Using Python 3.11.2 environment at: env
Audited in 2ms
Traceback (most recent call last):
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 24, in <module>
    main()
  File "/opt/inventree/src/backend/InvenTree/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/registry.py", line 116, in populate
    app_config.import_models()
  File "/opt/inventree/env/lib/python3.11/site-packages/django/apps/config.py", line 269, in import_models
    self.models_module = import_module(models_module_name)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/inventree/src/backend/InvenTree/build/models.py", line 32, in <module>
    import InvenTree.helpers_model
  File "/opt/inventree/src/backend/InvenTree/InvenTree/helpers_model.py", line 16, in <module>
    from PIL import Image
  File "/opt/inventree/env/lib/python3.11/site-packages/PIL/Image.py", line 88, in <module>
    from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/opt/inventree/env/lib/python3.11/site-packages/PIL/__init__.py)
# POI12| u | Installing required python packages from 'src/backend/requirements.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.5)
# POI12| u | Requirement already satisfied: setuptools in ./env/lib/python3.11/site-packages (66.1.1)
# POI12| u | Collecting setuptools
# POI12| u |   Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
# POI12| u |      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 10.0 MB/s eta 0:00:00
# POI12| u | Installing collected packages: setuptools
# POI12| u |   Attempting uninstall: setuptools
# POI12| u |     Found existing installation: setuptools 66.1.1
# POI12| u |     Uninstalling setuptools-66.1.1:
# POI12| u |       Successfully uninstalled setuptools-66.1.1
# POI12| u | Successfully installed setuptools-75.6.0
# POI12| u | Installing plugin packages from '/etc/inventree/plugins.txt'
# POI12| u | Requirement already satisfied: uv in ./env/lib/python3.11/site-packages (0.5.5)
# POI12| u | Python version 3.11.2 - /opt/inventree/env/bin/python3
# POI12| u | InvenTree configuration file 'config.yaml' not found - creating default file
# POI12| u | Created config file /etc/inventree/config.yaml
# POI12| Set permissions for data dir and media: /opt/inventree/data
# POI13| Setting up InvenTree config values
# POI13| Writing the settings to the config file /etc/inventree/config.yaml
# POI13| Done setting up InvenTree config values
# POI14| Setting up InvenTree site URL
# POI15| Starting InvenTree
# POI15| Started InvenTree
# POI16| Printing Final message
####################################################################################

@mschaffner9239
Copy link
Author

Here are the results from the following commands:

pip show pillow
pip show PIL

root@inventree12:/opt/inventree# source env/bin/activate
(env) root@inventree12:/opt/inventree# pip show pillow
Name: pillow
Version: 10.3.0
Summary: Python Imaging Library (Fork)
Home-page: 
Author: 
Author-email: "Jeffrey A. Clark" <[email protected]>
License: HPND
Location: /opt/inventree/env/lib/python3.11/site-packages
Requires: 
Required-by: django-stdimage, pdf2image, weasyprint
(env) root@inventree12:/opt/inventree# pip show PIL
WARNING: Package(s) not found: PIL
(env) root@inventree12:/opt/inventree# 

@SchrodingersGat
Copy link
Member

@mschaffner9239 can you please try the following (from this link)

Operating within your venv:

pip install --force-reinstall pillow

And then try to run the installer?

@mschaffner9239
Copy link
Author

Hi Oliver,

I don't think it is possible to run the installer while in the venv, I updated pillow and then when running the installer script I get:

(env) root@inventree12:~# bash install.sh 
### Installer for InvenTree - source: inventree/stable
### Detected distribution: Debian GNU/Linux 12
### Installing required packages for download
### Getting and adding key
### Adding package source
### Updating package lists
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                  
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease          
Get:4 https://dl.packager.io/srv/deb/inventree/InvenTree/stable/debian 11 InRelease [1,857 B]
Fetched 1,857 B in 1s (1,940 B/s)    
Reading package lists... Done
### Setting installer args
### Installing InvenTree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
inventree is already the newest version (0.16.9-1732958900.e0756a70.bullseye).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
### Install done!
(env) root@inventree12:~# 

@SchrodingersGat
Copy link
Member

Hmmm.. @matmair any thoughts on how to test this? It appears to be a compatibility issues with pillow, maybe from debian 12 in particular?

@matmair
Copy link
Member

matmair commented Dec 1, 2024

This looks like it could be a problem with uv as we are resolving for 3.9 but running on 3.11 when installing on debain 12.

@wolflu05
Copy link
Contributor

wolflu05 commented Dec 1, 2024

Just for context, I got the same error when setting up my dev env a few days ago and was able to resolve it by uninstalling and installing pillow.

As 3.9 will be EOL next October, shouldn't we bump the min version sometime soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug which needs to be addressed installer question This is a question setup Relates to the InvenTree setup / installation process
Projects
None yet
Development

No branches or pull requests

5 participants