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

Container won't run: "Cannot import name 'getargspec' from 'inspect' (/usr/local/lib/python3.12/inspect.py)" #313

Open
SlimG opened this issue Oct 25, 2023 · 1 comment

Comments

@SlimG
Copy link

SlimG commented Oct 25, 2023

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"]+"/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"]+"/entryID:re:\d+.xml")
lexonomy-main-1 | /opt/service/website/lexonomy.py:1111: SyntaxWarning: invalid escape sequence '\d'
lexonomy-main-1 | @get(siteconfig["rootPath"]+"/entryID:re:\d+")
lexonomy-main-1 | Traceback (most recent call last):
lexonomy-main-1 | File "/opt/service/website/lexonomy.py", line 17, in
lexonomy-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:

  1. Build docker image
  2. 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
@DewiBrynJones
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants