Container won't run: "Cannot import name 'getargspec' from 'inspect' (/usr/local/lib/python3.12/inspect.py)"
Describe the bug After building the 4.3 docker image, the container won't start, throwing the following errors:
slimg@server:~/docker/lexonomy$ docker compose up [+] Building 0.0s (0/0)
[+] Running 1/0 ✔ Container lexonomy-main-1 Created 0.0s Attaching to lexonomy-main-1 lexonomy-main-1 | /opt/service/website/lexonomy.py:51: SyntaxWarning: invalid escape sequence '.' lexonomy-main-1 | @route('/path:re:(widgets|furniture|libs|index.*\.html|config\.js|img|js\/|css|docs|dist|version\.txt).*') lexonomy-main-1 | /opt/service/website/lexonomy.py:684: SyntaxWarning: invalid escape sequence '\d' lexonomy-main-1 | @get(siteconfig["rootPath"]+"<dictID>/entryID:re:\d+/nabes.json") lexonomy-main-1 | /opt/service/website/lexonomy.py:691: SyntaxWarning: invalid escape sequence '\d' lexonomy-main-1 | @get(siteconfig["rootPath"]+"<dictID>/entryID:re:\d+.xml") lexonomy-main-1 | /opt/service/website/lexonomy.py:1111: SyntaxWarning: invalid escape sequence '\d' lexonomy-main-1 | @get(siteconfig["rootPath"]+"<dictID>/entryID:re:\d+") lexonomy-main-1 | Traceback (most recent call last): lexonomy-main-1 | File "/opt/service/website/lexonomy.py", line 17, inlexonomy-main-1 | import bottle lexonomy-main-1 | File "/usr/local/lib/python3.12/site-packages/bottle.py", line 44, in lexonomy-main-1 | from inspect import getargspec lexonomy-main-1 | ImportError: cannot import name 'getargspec' from 'inspect' (/usr/local/lib/python3.12/inspect.py). Did you mean: 'getargs'? lexonomy-main-1 exited with code 1
I've tried with the latest code of today, but get the same errormessage.
To Reproduce Steps to reproduce the behavior:
- Build docker image
- Run docker container from image
Expected behavior No errormessages and a running container
Environment (please complete the following information):
- OS: Ubuntu Server 22.04.2 LTS
- Docker: Docker Engine - Community 24.0.2
I had the same but fixed it by rolling back the python version from 3.12 (latest) to 3.10 in the Dockerfile..
i.e.
FROM python:3.10-alpine