2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

FAQ - removeSuffix error (#6081)

* Add FAQ entry about removeSuffix error

- Closes https://github.com/inventree/InvenTree/issues/6080

* Check python version in tasks.py
This commit is contained in:
Oliver 2023-12-13 22:20:50 +11:00 committed by GitHub
parent 902eafcc75
commit 68c3014232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -51,6 +51,12 @@ Most likely you are trying to run the InvenTree server from outside the context
Always activate the virtual environment before running server commands! Always activate the virtual environment before running server commands!
### 'str' object has no attribute 'removeSuffix'
This error occurs because your installed python version is not up to date. We [require Python v3.9 or newer](./start/intro.md#python-requirements)
You (or your system administrator) needs to update python to meet the minimum requirements for InvenTree.
## Update Issues ## Update Issues
Sometimes, users may encounter unexpected error messages when updating their InvenTree installation to a newer version. Sometimes, users may encounter unexpected error messages when updating their InvenTree installation to a newer version.

View File

@ -13,6 +13,35 @@ from platform import python_version
from invoke import task from invoke import task
def checkPythonVersion():
"""Check that the installed python version meets minimum requirements.
If the python version is not sufficient, exits with a non-zero exit code.
"""
REQ_MAJOR = 3
REQ_MINOR = 9
version = sys.version.split(" ")[0]
valid = True
if sys.version_info.major < REQ_MAJOR:
valid = False
elif sys.version_info.major == REQ_MAJOR and sys.version_info.minor < REQ_MINOR:
valid = False
if not valid:
print(f"The installed python version ({version}) is not supported!")
print(f"InvenTree requires Python {REQ_MAJOR}.{REQ_MINOR} or above")
sys.exit(1)
if __name__ in ['__main__', 'tasks']:
checkPythonVersion()
def apps(): def apps():
"""Returns a list of installed apps.""" """Returns a list of installed apps."""
return [ return [